diff options
| author | Jakob Unterwurzacher | 2017-05-07 22:15:01 +0200 | 
|---|---|---|
| committer | Jakob Unterwurzacher | 2017-05-07 22:16:22 +0200 | 
| commit | d5adde1eeb13ba377f7c05b9f21893c01f61ec16 (patch) | |
| tree | 011813ca5afd81ae6311bb007f5dc10ef69b2e7a /internal/exitcodes | |
| parent | ad7942f434fea567f24458e67a0919291b5ec8dd (diff) | |
exitcodes: pull all exit code definitions into the package
This commit defines all exit codes in one place in the exitcodes
package.
Also, it adds a test to verify the exit code on incorrect
password, which is what SiriKali cares about the most.
Fixes https://github.com/rfjakob/gocryptfs/issues/77 .
Diffstat (limited to 'internal/exitcodes')
| -rw-r--r-- | internal/exitcodes/exitcodes.go | 31 | 
1 files changed, 29 insertions, 2 deletions
| diff --git a/internal/exitcodes/exitcodes.go b/internal/exitcodes/exitcodes.go index 2ec3ae6..7a2efdb 100644 --- a/internal/exitcodes/exitcodes.go +++ b/internal/exitcodes/exitcodes.go @@ -8,12 +8,39 @@ import (  )  const ( +	// Usage error: cli syntax etc +	Usage = 1 +	// 2 is reserved because it is used by Go panic + +	// Mount is an error on mount +	Mount = 3 +	// CipherDir means that the CIPHERDIR does not exist +	CipherDir = 6 +	// Init is an error on filesystem init +	Init = 7 +	// LoadConf is an error while loading gocryptfs.conf +	LoadConf = 8 +	// ReadPassword means something went wrong reading the password +	ReadPassword = 9 +	// MountPoint error means that the mountpoint is invalid (not empty etc). +	MountPoint = 10  	// Other error - please inspect the message  	Other = 11  	// PasswordIncorrect - the password was incorrect  	PasswordIncorrect = 12 -	// TODO several other exit codes are defined in main.go. These will be -	// ported over here. +	// ScryptParams means that scrypt was called with invalid parameters +	ScryptParams = 13 +	// MasterKey means that something went wrong when parsing the "-masterkey" +	// command line option +	MasterKey = 14 +	// SigInt means we got SIGINT +	SigInt = 15 +	// PanicLog means the panic log was not empty when we were unmounted +	PanicLog = 16 +	// ForkChild means forking the worker child failed +	ForkChild = 17 +	// OpenSSL means you tried to enable OpenSSL, but we were compiled without it. +	OpenSSL = 18  )  // Err wraps an error with an associated numeric exit code | 
