Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Display correct error when handling an asset error #829

Merged
merged 1 commit into from
Aug 16, 2018
Merged

Fix: Display correct error when handling an asset error #829

merged 1 commit into from
Aug 16, 2018

Conversation

jeremypress
Copy link
Contributor

No description provided.

@boxcla
Copy link

boxcla commented Aug 16, 2018

Verified that @jeremypress has signed the CLA. Thanks for the pull request!

@@ -299,7 +299,7 @@ class BaseViewer extends EventEmitter {
*/
handleAssetError(err) {
const originalMessage = err ? err.message : '';
const error = new PreviewError(ERROR_CODE.LOAD_ASSET, '', {}, originalMessage);
const error = err instanceof PreviewError ? err : new PreviewError(ERROR_CODE.LOAD_ASSET, originalMessage, {});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If handleAssetError is called with a preview error, we should use that instead of creating a generic load asset error. More specific error types were replaced here.

@jeremypress jeremypress merged commit 2f70273 into box:master Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants