Import std.core.error
std.core.error
Error, the Class every error extends, and each area's own: one Error per area, whose Kind says what went wrong, so a Throws list stays short and a Catch can still tell kinds apart.
std/core/error.fb
Types
Place
struct
Public Struct Place Implements Printable
Where in a program's source something is: its file, as the build names it, and its line and column, from 1. A Place whose Line is 0 is nowhere yet.
-
Its file, as the build names it, or "" when it's nowhere.
-
Its line, from 1, or 0 when it's nowhere.
-
Its column, from 1.
-
Its file, line, and column, as "main.fb:3:5".
Error
class
Public Class Error
The Class every error extends. Its first fields are Message, Cause, and Place, in that order, which the runtime reads and writes: Throw sets Place, unless the error has one from an earlier Throw, and top-level code that lets an error out shows all three, and its Cause's.
-
What went wrong, for people to read.
-
The error this one comes from, as when code that catches one throws its own.
-
Where it was first thrown.
-
Makes an error that says
message, fromcause, if it has one.
ArgumentErrorKind
enum
Public Enum ArgumentErrorKind
What kind of ArgumentError it is.
-
A required argument that's missing.
-
An argument that isn't known.
-
An argument whose value doesn't fit.
-
Something else.
ArgumentError
class
Public Class ArgumentError Extends Error
A program's arguments, or another function's, that it can't take. Name is the argument's, when there is one.
-
What kind of argument it can't take.
-
The argument's name, or Null when it has none.
-
Public New(kind: ArgumentErrorKind, message: String, name: String? = Null, cause: Error? = Null)constructor #Makes an ArgumentError of
kindthat saysmessage, about the argumentname.
IOErrorKind
enum
Public Enum IOErrorKind
What kind of IOError it is.
-
A file or folder that isn't there.
-
A file or folder that the program may not use.
-
A file or folder that's there already.
-
A stream that ended too soon.
-
Bytes that aren't the format, or are broken.
-
A call the OS interrupted.
-
A file where a folder should be.
-
A folder where a file should be.
-
A folder with something in it.
-
A file that's in use, or locked.
-
A disk that's full.
-
A path no file can have, like one with a NUL in it, or one that's too long.
-
Something else.
IOError
class
Public Class IOError Extends Error
Reading or writing a file, a stream, or the console failed. Path is the file's, when there is one.
-
What kind of IOError it is.
-
The file or folder it's about, or Null when it's about none.
-
Public New(kind: IOErrorKind, message: String, path: String? = Null, cause: Error? = Null)constructor #Makes an IOError of
kindthat saysmessage, aboutpath.
ParseErrorKind
enum
Public Enum ParseErrorKind
What kind of ParseError it is.
-
Text that isn't the format.
-
Text that ends too soon.
-
A value of another type than the one asked for.
-
A number too big for its type.
-
A value that
Load<T>needs for a Field and doesn't have. -
Something else.
ParseError
class
Public Class ParseError Extends Error
Text that doesn't read as its format, at Line and Column, from 1, or 0 when it isn't known, or
a Value that Load<T> can't make a T from, at Path.
-
What kind of ParseError it is.
-
The line of what was read where it went wrong, from 1, or 0 when it has no lines.
-
The column on that line, from 1, or 0.
-
Public New(kind: ParseErrorKind, message: String, line: Int = 0, column: Int = 0, cause: Error? = Null, path: String? = Null)constructor #Makes a ParseError of
kindthat saysmessage, atlineandcolumn. -
For
Load<T>'s: where in the Value it's from, the Field's path, like "options.sizes[2]", or "" for the Value itself. Null for another error.
FormatErrorKind
enum
Public Enum FormatErrorKind
What kind of FormatError it is.
-
A template that isn't one.
-
A template that names a value it isn't given.
-
A value its spec doesn't fit.
-
Something else.
FormatError
class
Public Class FormatError Extends Error
A template that Format can't fill.
-
What kind of FormatError it is.
-
Makes a FormatError of
kindthat saysmessage.
TimeoutError
class
Public Class TimeoutError Extends Error
Something took longer than it was given.
CancelledError
class
Public Class CancelledError Extends Error
Work that stopped because a Cancellation said to.
NetErrorKind
enum
Public Enum NetErrorKind
What kind of NetError it is.
-
A connection the other side refused.
-
A connection the other side reset.
-
A network or host that can't be reached.
-
A host name that can't be found.
-
A connection that's closed.
-
TLS that failed.
-
An HTTP response whose status isn't success.
-
Something else.
NetError
class
Public Class NetError Extends Error
Talking over a network failed. Address is the other side's, when there is one.
-
What kind of NetError it is.
-
The address it's about, or Null when it's about none.
-
Public New(kind: NetErrorKind, message: String, address: String? = Null, cause: Error? = Null)constructor #Makes a NetError of
kindthat saysmessage, aboutaddress.
DatabaseErrorKind
enum
Public Enum DatabaseErrorKind
What kind of DatabaseError it is.
-
A constraint a change breaks.
-
A database that another connection holds.
-
A query that isn't one.
-
A file that isn't a database.
-
Something else.
DatabaseError
class
Public Class DatabaseError Extends Error
A database couldn't do what it was asked.
-
What kind of DatabaseError it is.
-
Makes a DatabaseError of
kindthat saysmessage.
Report an issue with this page or with FutureBlitz on GitHub.