OpenMLDB Error System #429
Replies: 6 comments 1 reply
-
Error CodeSuccess Code
General error
Unsupport
PlanError
CodegenError
CatalogError
CodecError
Runtime Error
RPC Error
Storage Error
External Error
Test Error
|
Beta Was this translation helpful? Give feedback.
-
TODO: Survey Error System in Popular DB: MySQL/porstgre/Sqlite/spark sql/redis/Tidb/Voltdb @aceforeverd @jingchen2222 |
Beta Was this translation helpful? Give feedback.
-
Survey Error System in Popular DB |
Beta Was this translation helpful? Give feedback.
-
Postgres:Three message type:
Formating/Writing guide:
links |
Beta Was this translation helpful? Give feedback.
-
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);
} |
Beta Was this translation helpful? Give feedback.
-
TiDB
|
Beta Was this translation helpful? Give feedback.
-
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_ENABLE
flagBeta Was this translation helpful? Give feedback.
All reactions