From 38d2c01bf0702fb309a8b3efe07579602e419c76 Mon Sep 17 00:00:00 2001 From: Yannick Chiasson Date: Tue, 6 Aug 2019 10:56:59 +0900 Subject: [PATCH] don't catch user's runtime exceptions --- src/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 10a01c4..d2bb7d0 100644 --- a/src/index.js +++ b/src/index.js @@ -64,12 +64,16 @@ class ActiveStorageProvider extends React.Component { handleSuccess = async (ids: string[]) => { if (ids.length === 0) return + let data try { - const data = await this._hitEndpointWithSignedIds(ids) - this.props.onSubmit(data) + data = await this._hitEndpointWithSignedIds(ids) } catch (e) { this.props.onError && this.props.onError(e) } + + if (data) { + this.props.onSubmit(data) + } } async _hitEndpointWithSignedIds(signedIds: string[]): Promise {