-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Site Editor: Display a notice if export fails #37131
Conversation
Size Change: +77 B (0%) Total Size: 1.11 MB
ℹ️ View Unchanged
|
downloadjs( blob, 'edit-site-export.zip', 'application/zip' ); | ||
} catch ( error ) { | ||
const errorMessage = | ||
error.message && error.code !== 'unknown_error' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are mutiple error code that could be returned here.
- rest_cannot_export_templates - permission error.
- missing_zip_package - Unable to generate ZIP because of missing package.
- unable_to_create_zip - Unable to generate ZIP for unknown reasons.
Should there be different error messages here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spacedmonkey, this is for default error message if the code is unknown. Otherwise, it will use messages returned from the server.
4aaed20
to
2de0c08
Compare
Hi, @spacedmonkey Is this PR in good shape to merge? |
Description
PR adds error handling for Site Editor export functionality.
P.S. I've also extracted the Export menu item into a separate component for convenience
How has this been tested?
Screenshots
Types of changes
Bugfix
Checklist:
*.native.js
files for terms that need renaming or removal).