Get Free Trial

How to handle erros from flexmonster.save

Answered
Ranjith asked on March 8, 2021

Hi,
How to check flexmonster.save methods successfully executed and how to catch if there is any exception thrown by flexmonster.save methos on the clienstside (javascript)

11 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster March 9, 2021

Hi Ranjith,
 
Thank you for posting your question.
 
Currently, Flexmonster’s save() API call does not throw an exception you can catch with a try...catch statement.
 
Depending on your use case, you could probably use the save method’s callback handler to execute some code once the report is saved successfully. Check out the following sample for illustration: https://jsfiddle.net/flexmonster/oz4382sL/.
 
Alternatively, in case you’re saving the report to the server, you could verify the save completion on the server-side instead.
 
Please let us know if there is anything else we can help you with.
 
Best regards,
Mykhailo

Public
Ranjith March 9, 2021

Yes we are saving the report to remote server Once if i call Flexmonster.Save API if it throws some error due to the server path is incorrect or path not found where can i catch that error
Hope am making the question more clear
Does the callbackHandler will trigger only if it success please let me know
 
Thanks

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster March 10, 2021

Hi Ranjith,
 
Thank you for your swift response.
 
We’ve just noticed that the save() method’s callback handler is not working properly – it executes the callback successfully even when errors occur during saving.
 
That being said, we will take a look at this and provide a solution that will let you detect the saving errors within the callback. This will be available with our upcoming release on ETA Apr 5th.
 
We’ll keep you posted.
 
Best regards,
Mykhailo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster April 6, 2021

Ranjith,
 
Hope you’re having a great day!
 
We’re happy to inform you that the save() API call now properly returns both success and error information. Check out the corresponding documentation page for more details.
 
This is available in the 2.8.30 version of Flexmonster: https://www.flexmonster.com/release-notes/.
 
Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/
 
Please let us know if there is anything else we can help you with.
 
Best regards,
Mykhailo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster April 13, 2021

Hi Ranjith,
 
How are you?
 
Just checking in to ask if you’ve had a chance to try out the updated save() API call. Is everything working well for you?
 
We’d be happy to hear your feedback.
 
Regards,
Mykhailo

Public
Ranjith April 13, 2021

I didn’t tried this one yet I will look in to it and let you know.
Do you know which version holds this functionality?
As always thanks for your help 

Public
Ranjith April 13, 2021

Also please provide the jsfiddle for this functionality

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster April 14, 2021

Ranjith,
 
This functionality was introduced in the most recent version, 2.8.30.
 
Here’s a quick JSFiddle illustrating the behavior: https://jsfiddle.net/flexmonster/ud7xzwqL/.
 
Please let us know your thoughts.
 
Regards,
Mykhailo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster April 22, 2021

Hi Ranjith,
 
Hope you’re having a great day!
 
We were wondering if you’ve found our previous response helpful. Does the new callback structure suit your use case?
 
Looking forward to your response.
 
Kind regards,
Mykhailo

Public
Ranjith April 27, 2021

Where can i download the version ( 2.8.30) for testing this one?

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster April 28, 2021

Ranjith,
 
Please see the relevant documentation page for an overview of different ways to download Flexmonster.
 
In case you’re using Flexmonster directly through npm, you can just use the npm update command instead.
 
Best regards,
Mykhailo

Please login or Register to Submit Answer