Fixed Upload File dialog ungracefully failing when failing to connect to the web-server.

Review Request #9200 — Created Sept. 22, 2017 and discarded — Latest diff uploaded

Information

Review Board
master

Reviewers

When failing to connect to the web-server, the server response message is parsed as a json object. If the server does not have a response message, the json object would be null, resulting in an error when trying to access members of the object.

Null checks were added for the json object, and if the object is null, the error message would default to "Unknown Error".

There were also issues with displaying the upload file dialog, where clicking Update -> Add File would not do anything.

The onUploadFileClicked() function was moved from reviewablePageView.es6.js to reviewRequestEditorView.es6.js, and the element's click function set to it.

Ran JSTests.

Tested manually by attempting to upload a file while the server was off. There were no javascript errors, and the displayed error message read "Unknown Error".

    Loading...