feat; properly parse errors
@@ -31,7 +31,11 @@ export class MessageHandler {
}
async sendMessage(message: __Message__): Promise<string> {
- return sendMessageAsync(JSON.stringify(message), this.messageHandler);
+ return sendMessageAsync(JSON.stringify(message), this.messageHandler)
+ .catch((error) => {
+ const _error = JSON.parse(error);
+ return Promise.reject(_error.payload);
+ });
}
async callAccountMethod(
