Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Enhance cli outputs on error #229

Merged
merged 6 commits into from
Oct 15, 2018
Merged

Conversation

jbcarpanelli
Copy link
Contributor

@jbcarpanelli jbcarpanelli commented Oct 10, 2018

Fixes zeppelinos/zos-cli#337.

  • Changed successfully written zos.network.json to a less possitive-everything-is-fine-wohoo! message (Created zos.network.json or Updated zos.network.json).
  • Only writing zos.network.json file if needed, whence only showing this message when the file is written.
  • Moved the error message right next to the action that caused it.


return proxy;
} catch(error) {
log.error(error.message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we rethrow here? otherwise, we will be swallowing that error, for example, we are using this scripts programmatically in other projects and we expect them to fail if sth went wrong, we should write and rethrow I think

@jbcarpanelli
Copy link
Contributor Author

I've implemented a new ScriptError class, that inherits from Error. This is not very generic though, but with some small changes (sending the second parameter of ScriptError constructor as an object), we can add other functionalities that we may want to execute after an error is thrown (e.g., writing a zos.error.log).

@jbcarpanelli jbcarpanelli added the status:to-review Awaiting review label Oct 15, 2018
@spalladino spalladino merged commit cd49f34 into master Oct 15, 2018
@spalladino spalladino deleted the enhance-cli-outputs-on-error branch October 15, 2018 16:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:to-review Awaiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants