You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using OpenCPU to incorporate R code into an existing application, and it needs to be able to handle OpenCPU errors internally instead of having them generate alerts or log to the console. For instance, when seturl() fails, it uses alert() to raise a dialog box. And as the connection is made, messages are logged with console.log().
When getting started, and in pages, the way opencpu.js uses alert() and console.log() is very helpful, so I still think that should be the default behavior. Would it be appropriate to create a flags on the ocpu object that tells it whether to use alert() or throw exceptions, and whether to log debug messages?
If this would be acceptable, I can submit a pull request.
The text was updated successfully, but these errors were encountered:
For regular function calls, the error is already customizable using the jqxhr.fail callback. See for example http://jsfiddle.net/opencpu/MkAVF/.
You are right that the behavior of errors that happen while initiating the library is currently hardcoded. If you think this is undesirable and can suggest a neat way of configuring this, send a pull request and I'll have a look.
I'm using OpenCPU to incorporate R code into an existing application, and it needs to be able to handle OpenCPU errors internally instead of having them generate alerts or log to the console. For instance, when seturl() fails, it uses alert() to raise a dialog box. And as the connection is made, messages are logged with console.log().
When getting started, and in pages, the way opencpu.js uses alert() and console.log() is very helpful, so I still think that should be the default behavior. Would it be appropriate to create a flags on the ocpu object that tells it whether to use alert() or throw exceptions, and whether to log debug messages?
If this would be acceptable, I can submit a pull request.
The text was updated successfully, but these errors were encountered: