go
Go Standard Library Errors
Sentinel error values exported by the Go standard library, used for identity comparisons with errors.Is().
20 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 20 codes
- 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.
- 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.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.
- 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.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.