use updated errors library
Signed-off-by: kim (grufwub) <grufwub@gmail.com>development
parent
0ecc21c1de
commit
1598f101f1
@ -1,27 +1,29 @@
|
||||
package core
|
||||
|
||||
import "github.com/grufwub/go-errors"
|
||||
import (
|
||||
"github.com/grufwub/go-errors"
|
||||
)
|
||||
|
||||
// Core ErrorCodes
|
||||
var (
|
||||
ErrConnWrite = errors.Error(connWriteErrStr)
|
||||
ErrConnRead = errors.Error(connReadErrStr)
|
||||
ErrConnClose = errors.Error(connCloseErrStr)
|
||||
ErrListenerAccept = errors.Error(listenerAcceptErrStr)
|
||||
ErrMutexUpgrade = errors.Error(mutexUpgradeErrStr)
|
||||
ErrMutexDowngrade = errors.Error(mutexDowngradeErrStr)
|
||||
ErrFileOpen = errors.Error(fileOpenErrStr)
|
||||
ErrFileStat = errors.Error(fileStatErrStr)
|
||||
ErrFileRead = errors.Error(fileReadErrStr)
|
||||
ErrFileType = errors.Error(fileTypeErrStr)
|
||||
ErrDirectoryRead = errors.Error(directoryReadErrStr)
|
||||
ErrRestrictedPath = errors.Error(restrictedPathErrStr)
|
||||
ErrUnescapingHost = errors.Error("")
|
||||
ErrUnescapingPath = errors.Error("")
|
||||
ErrParsingScheme = errors.Error("")
|
||||
ErrParsingHost = errors.Error("")
|
||||
ErrParsingURI = errors.Error("")
|
||||
ErrInvalidRequest = errors.Error(invalidRequestErrStr)
|
||||
ErrCGIStart = errors.Error(cgiStartErrStr)
|
||||
ErrCGIExitCode = errors.Error(cgiExitCodeErrStr)
|
||||
ErrConnWrite = errors.BaseError("conn write error")
|
||||
ErrConnRead = errors.BaseError("conn read error")
|
||||
ErrConnClose = errors.BaseError("conn close error")
|
||||
ErrListenerAccept = errors.BaseError("listener accept")
|
||||
ErrMutexUpgrade = errors.BaseError("mutex upgrade fail")
|
||||
ErrMutexDowngrade = errors.BaseError("mutex downgrade fail")
|
||||
ErrFileOpen = errors.BaseError("file open error")
|
||||
ErrFileStat = errors.BaseError("file stat error")
|
||||
ErrFileRead = errors.BaseError("file read error")
|
||||
ErrFileType = errors.BaseError("unsupported file type")
|
||||
ErrDirectoryRead = errors.BaseError("directory read error")
|
||||
ErrRestrictedPath = errors.BaseError("restricted path")
|
||||
ErrUnescapingHost = errors.BaseError("unescaping host")
|
||||
ErrUnescapingPath = errors.BaseError("unescaping path")
|
||||
ErrParsingScheme = errors.BaseError("scheme parse fail")
|
||||
ErrParsingHost = errors.BaseError("host parse fail")
|
||||
ErrParsingURI = errors.BaseError("URI parse fail")
|
||||
ErrInvalidRequest = errors.BaseError("invalid request")
|
||||
ErrCGIStart = errors.BaseError("CGI start error")
|
||||
ErrCGIExitCode = errors.BaseError("CGI non-zero exit code")
|
||||
)
|
||||
|
@ -1,84 +0,0 @@
|
||||
package core
|
||||
|
||||
// Error string constants
|
||||
const (
|
||||
connWriteErrStr = "Conn write error"
|
||||
connReadErrStr = "Conn read error"
|
||||
connCloseErrStr = "Conn close error"
|
||||
listenerAcceptErrStr = "Listener accept error"
|
||||
mutexUpgradeErrStr = "Mutex upgrade fail"
|
||||
mutexDowngradeErrStr = "Mutex downgrade fail"
|
||||
fileOpenErrStr = "File open error"
|
||||
fileStatErrStr = "File stat error"
|
||||
fileReadErrStr = "File read error"
|
||||
fileTypeErrStr = "Unsupported file type"
|
||||
directoryReadErrStr = "Directory read error"
|
||||
restrictedPathErrStr = "Restricted path"
|
||||
invalidHostErrStr = "Invalid host"
|
||||
invalidRequestErrStr = "Invalid request"
|
||||
cgiStartErrStr = "CGI start error"
|
||||
cgiExitCodeErrStr = "CGI non-zero exit code"
|
||||
)
|
||||
|
||||
// Log string constants
|
||||
const (
|
||||
hostnameBindEmptyStr = "At least one of 'hostname' or 'listen' must be non-empty!"
|
||||
|
||||
chrootStr = "Chrooting into dir: %s"
|
||||
chrootErrStr = "Error chrooting into directory: %s"
|
||||
|
||||
chDirStr = "Entered server dir: %s"
|
||||
chDirErrStr = "Error entering server directory: %s"
|
||||
|
||||
rootDirEmptyErrStr = "No server root directory supplied!"
|
||||
|
||||
userLookupErrStr = "Error looking up user: %s"
|
||||
groupLookupErrStr = "Error looking up group: %s"
|
||||
currentUserLookupErrStr = "Error looking up current user: %s"
|
||||
|
||||
setuidStr = "Running as user: %s"
|
||||
setuidErrStr = "Error performing setuid: %s"
|
||||
|
||||
setgidStr = "Running as group: %s"
|
||||
setgidErrStr = "Error performing setgid: %s"
|
||||
|
||||
runningAsRootErrStr = "Gophi does not support running as root!"
|
||||
|
||||
listenerBeginFailStr = "Failed to start listener on %s://%s:%s (%s:%s) - %s"
|
||||
listeningOnStr = "Listening on %s://%s:%s (%s:%s)"
|
||||
|
||||
cacheMonitorStartStr = "Starting cache monitor with freq: %s"
|
||||
cacheFileStatErrStr = "Failed to stat file in cache: %s"
|
||||
|
||||
pathRestrictionsEnabledStr = "Path restrictions enabled"
|
||||
pathRestrictionsDisabledStr = "Path restrictions disabled"
|
||||
pathRestrictRegexCompileFailStr = "Failed compiling restricted path regex: %s"
|
||||
pathRestrictRegexCompiledStr = "Compiled restricted path regex: %s"
|
||||
|
||||
pathHidingEnabledStr = "Path hiding enabled"
|
||||
pathHidingDisableStr = "Path hiding disabled"
|
||||
pathHidingRegexCompileFailStr = "Failed compiling hidden path regex: %s"
|
||||
pathHidingRegexCompiledStr = "Compiled hidden path regex: %s"
|
||||
|
||||
requestRemapEnabledStr = "Request remapping enabled"
|
||||
requestRemapDisabledStr = "Request remapping disabled"
|
||||
requestRemapRegexInvalidStr = "Invalid request remap regex: %s"
|
||||
requestRemapRegexCompileFailStr = "Failed compiling request remap regex: %s"
|
||||
requestRemapRegexCompiledStr = "Compiled path remap regex: %s"
|
||||
requestRemappedStr = "Remapped request: %s %s"
|
||||
|
||||
cgiPathStr = "CGI safe path: %s"
|
||||
cgiSupportEnabledStr = "CGI script support enabled"
|
||||
cgiSupportDisabledStr = "CGI script support disabled"
|
||||
cgiDirNotRelativeStr = "CGI directory must be a relative path!"
|
||||
cgiDirStr = "CGI directory: %s"
|
||||
cgiExecuteErrStr = "Exit executing: %s [%d]"
|
||||
|
||||
userSpacesEnabledStr = "User spaces support enabled"
|
||||
userSpacesDisabledStr = "User spaces support disabled"
|
||||
userSpacesStr = "User space directory: %s"
|
||||
|
||||
signalReceivedStr = "Signal received: %v. Shutting down..."
|
||||
|
||||
logOutputErrStr = "Error opening log output %s: %s"
|
||||
)
|
@ -1,39 +0,0 @@
|
||||
package gemini
|
||||
|
||||
// Client error response strings
|
||||
const (
|
||||
statusMeta10 = "Input"
|
||||
statusMeta11 = "Sensitive Input"
|
||||
statusMeta30 = "Temporary Redirect"
|
||||
statusMeta31 = "Permanent Redirect"
|
||||
statusMeta40 = "Temporary Failure"
|
||||
statusMeta41 = "Server Unavailable"
|
||||
statusMeta42 = "CGI Error"
|
||||
statusMeta43 = "Proxy Error"
|
||||
statusMeta44 = "Slow Down"
|
||||
statusMeta50 = "Permanent Failure"
|
||||
statusMeta51 = "Not Found"
|
||||
statusMeta52 = "Gone"
|
||||
statusMeta53 = "Proxy Request Refused"
|
||||
statusMeta59 = "Bad Request"
|
||||
statusMeta60 = "Client Certificate Required"
|
||||
statusMeta61 = "Client Certificate Not Authorised"
|
||||
statusMeta62 = "Certificate Not Valid"
|
||||
)
|
||||
|
||||
// Gemini specific error string constants
|
||||
const (
|
||||
invalidTLSConfigErrStr = "Invalid TLS cert or key file"
|
||||
inavlidProtocolErrStr = "Invalid request protocol"
|
||||
invalidHostPortErrStr = "Invalid host:port pair"
|
||||
)
|
||||
|
||||
// Log string constants
|
||||
const (
|
||||
entropyAssertFailStr = "Failed to assert safe source of system entropy exists!"
|
||||
clientReadFailStr = "Failed to read"
|
||||
invalidRequestStr = "Invalid request: %s"
|
||||
clientServeFailStr = "Failed to serve: %s"
|
||||
clientServedStr = "Served: %s"
|
||||
clientRedirectStr = "Redirect to: %s"
|
||||
)
|
Loading…
Reference in New Issue