-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cue: repurpose exitOnErr into printError
The only call site with fatal=true was in buildInstances, which now returns an error just like all the others. exitOnErr is now printError, since fatal was always false at this point, and panicExit and recoverError can be deleted as unused now. We now "just" have two ways to stop a command with errors: returning an arbitrary error, and returning ErrPrintedError. Stopping a command by panicking with panicExit is no longer possible. Note that fmt.go replaces uses of the non-fatal exitOnErr with error returns which stop further processing. This is intentional; after recent refactors, `cue fmt` is now inconsistent in terms of which errors it considers fatal. For the time being, it makes sense for fmt to stop at the first error. If we want to start treating some errors as non-fatal, such as parsing or formatting errors, we should first have tests in place that show the tool continuing to format more files. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I847be07f721fdb8cc64bfd6312b72615d4d70755 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194538 Reviewed-by: Roger Peppe <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information
Showing
6 changed files
with
81 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters