go
Go Standard Library Errors
Sentinel error values exported by the Go standard library, used for identity comparisons with errors.Is().
27 codes
references pkg.go.dev/iopkg.go.dev/ospkg.go.dev/contextpkg.go.dev/database/sqlpkg.go.dev/netpkg.go.dev/net/http
· All codes 27 codes
- bufio.ErrBufferFull Buffer Full Returned by bufio.Scanner when a single token (line, word, etc.) is larger than the scanner's buffer. Call scanner.Buffer() before scanning to increase the maximum token size.
- context.Canceled Context Cancelled The operation was cancelled because the context was cancelled via its CancelFunc. Check with errors.Is(err, context.Canceled).
- context.DeadlineExceeded Context Deadline Exceeded The context's deadline passed before the operation completed. Implements both error and context.DeadlineExceeded interfaces.
- exec.ErrNotFound Executable Not Found Returned by os/exec when the named program cannot be found as an executable in any of the directories listed in $PATH. Check that the binary is installed and on PATH, or pass an absolute path instead.
- http.ErrAbortHandler Abort Handler A panic value used to abort an HTTP handler and close the connection without sending a response. Panicking with this value suppresses the server's stack trace logging.
- http.ErrNoCookie No Cookie Returned by Request.Cookie when no cookie with the requested name is present in the request. Check the cookie name or handle the error to provide a default.
- http.ErrServerClosed Server Closed Returned by Server.Serve after Server.Shutdown or Server.Close is called. Callers should treat this as a normal shutdown signal, not an error.
- io.EOF End of File Returned by Read when no more input is available. Callers should treat EOF as a graceful end-of-stream signal, not an error.
- io.ErrClosedPipe Closed Pipe Read or write on a pipe after the other end has been closed.
- io.ErrNoProgress No Progress Multiple Read calls on a Reader have returned no data and no error. Indicates a broken Reader implementation.
- io.ErrShortBuffer Short Buffer Read required a longer buffer than was provided. The caller must supply a larger buffer to receive the data.
- io.ErrShortWrite Short Write Write accepted fewer bytes than requested but returned no error. Indicates a broken Writer implementation.
- io.ErrUnexpectedEOF Unexpected EOF EOF encountered in the middle of reading a fixed-size block or data structure. Indicates the stream ended before a complete record was read.
- net.ErrClosed Network Connection Closed Operation on a network connection that has already been closed. Use errors.Is to match wrapped instances of this error.
- net.ErrWriteToConnected Write To Connected Returned when WriteTo is called on an already-connected UDP socket. Use Write instead once the socket is connected with Connect.
- os.ErrDeadlineExceeded I/O Deadline Exceeded I/O deadline set on a file or network connection has passed. Distinct from context.DeadlineExceeded — this applies to OS-level I/O deadlines.
- os.ErrExist File Already Exists File or directory already exists. Wraps the underlying OS error (EEXIST on Unix).
- os.ErrInvalid Invalid Argument Returned when an operation is attempted on a nil or closed File, or when an argument is otherwise invalid. Ensure the file or resource is properly opened before use.
- os.ErrNoDeadline No Deadline Set No deadline is set on the file or connection. Returned when attempting to retrieve a deadline that has not been configured.
- os.ErrNotExist File Does Not Exist File or directory does not exist. Wraps the underlying OS error (ENOENT on Unix). Use errors.Is(err, os.ErrNotExist) rather than comparing directly.
- os.ErrPermission Permission Denied Permission denied for the requested file operation. Wraps the underlying OS error (EACCES or EPERM on Unix).
- os.ErrProcessDone Process Already Done The process has already finished. Returned when operating on a process that has exited.
- sql.ErrConnDone Connection Done The database connection has already been returned to the pool or closed. Operations on the connection are no longer valid.
- sql.ErrNoRows No Rows Returned by QueryRow.Scan when the query returns no rows. Not returned by Query — callers must check rows.Next() themselves.
- sql.ErrTxDone Transaction Done The transaction has already been committed or rolled back. Further operations on it return this error.
- strconv.ErrRange Value Out Of Range Returned by strconv parsing functions when the input value is syntactically valid but falls outside the range of the target type (e.g. parsing '300' into a uint8). Use a wider type or validate the value before converting.
- strconv.ErrSyntax Invalid Syntax Returned by strconv functions (Atoi, ParseInt, ParseFloat, etc.) when the input string is not a valid representation of the requested type. Unwrap the *strconv.NumError to inspect the problematic value.