topcoderinc / TC-redis-manager

5 stars 16 forks source link

error handling normalization in front-end #467

Open standlove opened 5 years ago

standlove commented 5 years ago

Now we can consolidate the error handling in one place.

If the received error is 500 with message = ConnectFailed or ConnectTimeout, dispatch the RedisConnectFailed event.

If the command is from CLI, we will just display the message in CLI directly; otherwise, we can simply display the error with: this.util.showMessage(message).

The "Fail to import xxx" etc. prefix is not necessary.

And an extra note about the error from import dialog, you should show the lineNo of the failed command as well.

And the dialog should only be auto-closed if the operation is successful. Don't close it if there is any error.