Introduction
I'm working on react native module exception design. I need some tool class to help me design more general cross platform error exception which used to be javascript layer. I don't want to write different handlers for different platform so that i looked the react native FileReaderModule.

In FileReaderModule, we could see react native team use Promise interface to resolve and reject the result. but there is two different error codes here.
# in objc
NSString *const RCTErrorUnspecified = @"EUNSPECIFIED";
# in java
private static final String ERROR_INVALID_BLOB = "ERROR_INVALID_BLOB";
I think probably we need design more cross platform Promise interface or add a new ExceptionModule for react native Promise interface.
Proposals of ExceptionModule
interface RCTErrorModule {
code: string,
description: string
};
promise.reject(new RCTErrorModule(code: "errorCode", description: "description"));
Introduction
I'm working on react native module exception design. I need some tool class to help me design more general cross platform error exception which used to be javascript layer. I don't want to write different handlers for different platform so that i looked the react native FileReaderModule.
In FileReaderModule, we could see react native team use Promise interface to resolve and reject the result. but there is two different error codes here.
I think probably we need design more cross platform Promise interface or add a new ExceptionModule for react native Promise interface.
Proposals of ExceptionModule