Quick one. Anyone experience a '500' error with R...
# suitescript
d
Quick one. Anyone experience a '500' error with RESTlets? Seems random. Should I just implement a retry or should I dig deeper (I ask because 90% there is no issue .. .no code change)
t
How are you referencing the of the RESTlet? Is it hardcoded? A couple weeks ago they changed the url to add the client id in it, and that broke some integrations we had with stuff
But I've also had periods where even some Netsuite pages would hang or send an error
d
Interesting @Tyler Bobik. I'll look into that. However, its not everytime
s
Intermittent 500 errors are usually the result of an outage or system failure, so they likely aren't an issue with your code or data. You can't really avoid them either, in the real world. Retries are a good strategy, though for extended outages they may not work. Also, you should make your restlet calls idempotent wherever possible, just in case you accidentally retry a request that succeeded, but you didn't get a response. Then you can retry requests with confidence. If you are getting them frequently, though, that could be a problem. You may then want to open a case with Netsuite.
t
@darrenhillconsulting Ok, if it's not every time then what @scottvonduhn suggested is probably the best and doing retries
s
Another thing is to try and avoid long running restlet scripts. You'll minimize the chances of being interrupted in the middle by an outage or restart, and your calling code will know if the call succeeded or failed sooner.
d
Thanks guys!