Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a debug mode to the installer #81

Open
btkelly opened this issue Mar 16, 2017 · 1 comment
Open

Add a debug mode to the installer #81

btkelly opened this issue Mar 16, 2017 · 1 comment

Comments

@btkelly
Copy link
Owner

btkelly commented Mar 16, 2017

Add a debug mode to the install process to set a global debug flag for Gandalf. This flag should be used to allow Gandalf to be more error tolerant during release builds. When in debug mode Gandalf should loudly throw exceptions when things are unexpected to allow a developer to resolve the issue easily. When in release mode Gandalf should swallow all exceptions if possible and log them based on the LogLevel set during install. This will remove the possibility of an error in configuration causing the app to crash or block the user from using the app completely.

@peikedai
Copy link

peikedai commented Mar 21, 2017

I like the idea of throwing unchecked exception to the developer user of the library when in debugging mode. However it will make the debugging harder if a production app uses a wrong JSON format, e.g. invalid version code.

Since the BootstrapApi class is already reporting JSON syntax error, and the invalid versionCode can also be categorized to the same error type as "breaking the input contract".

I think it would be a good idea to throwing checked exception and force the developer user to recover from the condition. There can be a new method onError(GandalfException exception) in GandalfCallback. In that way the user can decide in their app to whether allow their user to continue using when Gandalf throws an Error, or any way else.

In the Gandalf, if the BootstarpCallback implementation received a onError call, instead of do nothing, we can directly call gandalfCallback.onError(...) to pass it down to the user to handle.

With that, even in the production app, developer can easily find the cause from the log if their setup in the server didn't trigger the Gandalf properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants