Skip to content

Commit

Permalink
merge from RBQL v0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
mechatroner committed Apr 1, 2020
1 parent 782296f commit ebffd71
Show file tree
Hide file tree
Showing 4 changed files with 346 additions and 131 deletions.
17 changes: 1 addition & 16 deletions rbql-js/cli_rbql.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,8 @@ function report_error_json(error_type, error_msg) {
}


function exception_to_error_info(e) {
let exceptions_type_map = {
'RbqlRuntimeError': 'query execution',
'RbqlParsingError': 'query parsing',
'RbqlIOHandlingError': 'IO handling'
};
let error_type = 'unexpected';
if (e.constructor && e.constructor.name && exceptions_type_map.hasOwnProperty(e.constructor.name)) {
error_type = exceptions_type_map[e.constructor.name];
}
let error_msg = e.hasOwnProperty('message') ? e.message : String(e);
return [error_type, error_msg];
}


function show_exception(e) {
let [error_type, error_msg] = exception_to_error_info(e);
let [error_type, error_msg] = rbql.exception_to_error_info(e);
if (error_format == 'hr') {
show_error_plain_text(error_type, error_msg);
} else {
Expand Down
Loading

0 comments on commit ebffd71

Please sign in to comment.