Page 1 of 1
how to track error and error code while EDITOR_LOADING_FAILED
Posted: Mon Jul 17, 2023 9:30 am
by shikhar_472
Hi Team,
How to track the error and error status code when document go into event EDITOR_LOADING_FAILED,
I am passing the editor object which contains below data i want to provide the alert box according the error status code and error
image.png
Re: how to track error and error code while EDITOR_LOADING_FAILED
Posted: Mon Jul 17, 2023 11:36 am
by Gabriel Titerlea
Hello,
We don't expose this information to javascript-plugin-code.
How/From where are you loading your documents? Are you using the WebDav plugin?
Best,
Gabriel
Re: how to track error and error code while EDITOR_LOADING_FAILED
Posted: Mon Jul 17, 2023 11:53 am
by shikhar_472
yes i am using the web-dav plugin if in case any error occures in rest call it want to alert the message according to the error code
http://localhost/oxygen-xml-web-author/ ... Only=false
Re: how to track error and error code while EDITOR_LOADING_FAILED
Posted: Mon Jul 17, 2023 3:46 pm
by Gabriel Titerlea
Hello,
One way to change the error message is by modifying the code that reads the content from WebDav [1]. You can throw an IOException with the error message you want and this error message will be displayed when loading fails.
Alternatively, you can rewrite the document loading code. You can prevent the default document load and instead, load the document using javascript code. This way you have control over error handling, you will have to implement it yourself. But since this approach requires many code changes I will only talk about it if you want to go this route, if the above solution doesn't work for you.
Best,
Gabriel
[1]
https://github.com/oxygenxml/web-author ... #L110-L146