diff options
Diffstat (limited to 'core/ops.rs')
-rw-r--r-- | core/ops.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/ops.rs b/core/ops.rs index ab233ef29..f62fe7a8e 100644 --- a/core/ops.rs +++ b/core/ops.rs @@ -140,6 +140,7 @@ pub struct OpError { #[serde(rename = "$err_class_name")] class_name: &'static str, message: String, + code: Option<&'static str>, } pub fn serialize_op_result<R: Serialize + 'static>( @@ -151,6 +152,7 @@ pub fn serialize_op_result<R: Serialize + 'static>( Err(err) => OpResult::Err(OpError { class_name: (state.borrow().get_error_class_fn)(&err), message: err.to_string(), + code: crate::error_codes::get_error_code(&err), }), } } |