Mercurial > public > mercurial-scm > hg
comparison rust/hg-core/src/exit_codes.rs @ 47407:6e49769b7f97
rhg: add exit code to HgError::Abort()
My previous attempts to have rhg end with correct exit code was more of bug
hunting. I found cases which were failing and fixed them. But as one might
expect, more tests started failing.
Let's add exit code `HgError::Abort()` and make it users explicitly tell what
exit code they want.
Differential Revision: https://phab.mercurial-scm.org/D10838
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 07 Jun 2021 17:27:49 +0530 |
parents | |
children | 006688e36e12 |
comparison
equal
deleted
inserted
replaced
47406:3237ed4dcda4 | 47407:6e49769b7f97 |
---|---|
1 pub type ExitCode = i32; | |
2 | |
3 /// Successful exit | |
4 pub const OK: ExitCode = 0; | |
5 | |
6 /// Generic abort | |
7 pub const ABORT: ExitCode = 255; | |
8 | |
9 // Abort when there is a config related error | |
10 pub const CONFIG_ERROR_ABORT: ExitCode = 30; | |
11 | |
12 // Abort when there is an error while parsing config | |
13 pub const CONFIG_PARSE_ERROR_ABORT: ExitCode = 10; | |
14 | |
15 /// Generic something completed but did not succeed | |
16 pub const UNSUCCESSFUL: ExitCode = 1; | |
17 | |
18 /// Command or feature not implemented by rhg | |
19 pub const UNIMPLEMENTED: ExitCode = 252; |