www.dextsolution.com
DEXTUPLOAD
X5
menu toggleProduct description > Error Handling

Error Handling

Errors that generate a DEXTUploadX5 component are passed to the onDX5Error callback function.

OnDX5Error may not pass all errors when the module creation is disabled or the function is blocked due to external influences.

/**
 * All error and warning messages passed through the component or inside can be retrieved via the onDX5Error callback function.
 * @param {string} id The ID of the component for which the error or warning occurred.
 * @param {string} code error code
 * @param {string} msg error message
 */
function onDX5Error(id, code, msg) {
  alert(id + " => " +  code + "\n" + msg);
}

If the onDX5Error function is not in the page, there is no way to check for errors, and DEXTUploadX5 does not have a logging facility to record errors separately except the onDX5Error function.

The onDX5Error function is not responsible for any grammatical or logical script errors that occur during development.

ESVG-##### error code

Error codes passed inside a component are always in the form ESVG-#####.

However, errors that can not be caught by the error handler function follow the error propagation mechanism in the browser. Therefore, if the component has something wrong, you can use the error console provided by each browser (usually by using the F12 key and turning on the console for Safari (macOS)). You should check to see if it happened.

EHD-#-## error code

They are errors that occurred in HD application.

EX5-# error code

Errors starting with EX5 are errors that occur in external managed objects, not components, and include issues that occur during the pre-component creation process and errors that occur during communication with HD applications.

This error format only supports English resources.

Notices

If an error occurs in the server after uploading the file, it is judged that the uploading has failed.

HTTP will return an HTTP status code of 200 if the code completes successfully on the server when doing a GET, POST request (as does file upload).

When DEXTUploadX5 receives the 200 code value from the server, it determines that the file upload is completed, and calls the onDX5UploadCompleted callback function.

On the other hand, if the server sends an HTTP status code, such as 400, 403, 404, or 500, it determines that an error has occurred, stops additional operations, and calls the onDX5Error callback function.

Therefore, server-side code should not ignore an error, package it in a different format, and take action to ensure that 500 errors are delivered when an exception occurs.

If the server catches an error like a try - catch statement and does not pass an error, the server will return a value of 200, so DEXTUploadX5 will determine that the upload was successful.

In addition, when an error occurs in the server, the error page is often sent to the client. However, since the status code is 200, the DEXTUploadX5 judges that the upload has been completed successfully.