Skip to content

Commit

Permalink
Reject non validation errors from introspect-address onReceieve. This…
Browse files Browse the repository at this point in the history
… does not include client-side handling
  • Loading branch information
rhyslbw committed Jul 1, 2020
1 parent 48855d5 commit 14eb920
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/main/ipc/introspect-address.js
Expand Up @@ -17,16 +17,21 @@ export const introspectAddressChannel: MainIpcChannel<
export const handleAddressIntrospectionRequests = () => {
introspectAddressChannel.onReceive(
(request: IntrospectAddressRendererRequest) =>
new Promise(resolve => {
new Promise((resolve, reject) => {
exec(
`echo ${request.input} | cardano-address address inspect`,
(error, stdout) => {
if (error) {
if (error && error.message.match(/user error \(Unrecognized address on standard input\)/g) !== null) {
return resolve('Invalid');
}
if (error) {
reject(error)
}
return resolve({ introspection: JSON.parse(stdout) });
}
);
})
);
};


0 comments on commit 14eb920

Please sign in to comment.