chore: LCException
parent
b5980c839c
commit
4bb16ce423
|
@ -47,8 +47,8 @@ namespace LeanCloud.Engine {
|
|||
object result = await LCEngine.Invoke(mi, req);
|
||||
if (result != null) {
|
||||
return new Dictionary<string, object> {
|
||||
{ "result", result }
|
||||
};
|
||||
{ "result", result }
|
||||
};
|
||||
}
|
||||
}
|
||||
return default;
|
||||
|
|
|
@ -213,7 +213,14 @@ namespace LeanCloud.Engine {
|
|||
}
|
||||
return mi.Invoke(null, ps);
|
||||
} catch (TargetInvocationException e) {
|
||||
throw e.InnerException;
|
||||
Exception ex = e.InnerException;
|
||||
if (ex is LCException lcEx) {
|
||||
throw new Exception(JsonConvert.SerializeObject(new Dictionary<string, object> {
|
||||
{ "code", lcEx.Code },
|
||||
{ "message", lcEx.Message }
|
||||
}));
|
||||
}
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue