OpenMLDB Error System #429
jingchen2222
started this conversation in
Ideas
Replies: 6 comments 1 reply
Error CodeSuccess CodeGeneral errorUnsupportPlanErrorCodegenErrorCatalogErrorCodecErrorRuntime ErrorRPC ErrorStorage ErrorExternal ErrorTest Error |
0 replies
|
TODO: Survey Error System in Popular DB: MySQL/porstgre/Sqlite/spark sql/redis/Tidb/Voltdb @aceforeverd @jingchen2222 |
1 reply
Survey Error System in Popular DB |
0 replies
Postgres:Three message type:
Formating/Writing guide:
links |
0 replies
MySQLError reference
https://dev.mysql.com/doc/refman/5.7/en/perror.html
Error message formatpublic abstract class BaseException extends RuntimeException {
//...
public static final String message(ErrorCode code, String... params) {
String msg = (CODE_MESSAGES.isEmpty() || !CODE_MESSAGES.containsKey(code)) ? code.getMessage() : CODE_MESSAGES.get(code);
if (params != null) {
msg = String.format(msg, params);
}
return msg;
}
}public final class DBException extends BaseException {
private DBException(ErrorModule module, ErrorCode code, String message, Throwable cause) {
super(module, code, message, cause);
}
public static DBException get(ErrorModule module, ErrorCode code, String... params) {
return get(module, code, true, params);
}
public static DBException get(ErrorModule module, ErrorCode code, boolean format, String... params) {
return new DBException(module, code, format ? message(code, params) : params[0], null);
}
public static DBException get(ErrorModule module, ErrorCode code, Throwable cause, String... params) {
return new DBException(module, code, message(code, params), cause);
}
}// ER_BAD_FIELD_ERROR(1054, "42S22", "Unknown column '%s' in '%s'"),
if (result.offset == -1) {
throw DBException.get(ErrorModule.PARSER, ErrorCode.ER_BAD_FIELD_ERROR, oriCol, oriTable);
} |
0 replies
TiDB
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Motivation
Users can get frustrated when they use OpenMLDB in the wrong way. e.g. SQL Syntax errors, unsupported data types, unsupported query on specific running mode. What's worse, the error message can be misleading in some cases which might make users more confused.
So it's very important to improve, refactor if need, the whole error message system in a way to make the error message clear and readable.
TRACE_ENABLEflagAll reactions