Skip to content
FutureBlitz

    Install

    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.

    std/core/error.fb, line 8

    • Public ReadOnly Field File: String field #

      Its file, as the build names it, or "" when it's nowhere.

    • Public ReadOnly Field Line: Int field #

      Its line, from 1, or 0 when it's nowhere.

    • Public ReadOnly Field Column: Int field #

      Its column, from 1.

    • Public Method ToString(): String method #

      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.

    std/core/error.fb, line 23

    • Public Field Message: String field #

      What went wrong, for people to read.

    • Public Field Cause: Error? field #

      The error this one comes from, as when code that catches one throws its own.

    • Public ReadOnly Field Place: Place field #

      Where it was first thrown.

    • Public New(message: String = "", cause: Error? = Null) constructor #

      Makes an error that says message, from cause, if it has one.

    ArgumentErrorKind enum

    Public Enum ArgumentErrorKind

    What kind of ArgumentError it is.

    std/core/error.fb, line 39

    • MISSING enum member #

      A required argument that's missing.

    • UNKNOWN enum member #

      An argument that isn't known.

    • INVALID enum member #

      An argument whose value doesn't fit.

    • OTHER enum member #

      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.

    std/core/error.fb, line 52

    • Public ReadOnly Field Kind: ArgumentErrorKind field #

      What kind of argument it can't take.

    • Public ReadOnly Field Name: String? field #

      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 kind that says message, about the argument name.

    IOErrorKind enum

    Public Enum IOErrorKind

    What kind of IOError it is.

    std/core/error.fb, line 68

    • NOT_FOUND enum member #

      A file or folder that isn't there.

    • PERMISSION_DENIED enum member #

      A file or folder that the program may not use.

    • ALREADY_EXISTS enum member #

      A file or folder that's there already.

    • UNEXPECTED_END enum member #

      A stream that ended too soon.

    • INVALID_DATA enum member #

      Bytes that aren't the format, or are broken.

    • INTERRUPTED enum member #

      A call the OS interrupted.

    • NOT_A_DIRECTORY enum member #

      A file where a folder should be.

    • IS_A_DIRECTORY enum member #

      A folder where a file should be.

    • NOT_EMPTY enum member #

      A folder with something in it.

    • BUSY enum member #

      A file that's in use, or locked.

    • NO_SPACE enum member #

      A disk that's full.

    • INVALID_PATH enum member #

      A path no file can have, like one with a NUL in it, or one that's too long.

    • OTHER enum member #

      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.

    std/core/error.fb, line 99

    • Public ReadOnly Field Kind: IOErrorKind field #

      What kind of IOError it is.

    • Public ReadOnly Field Path: String? field #

      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 kind that says message, about path.

    ParseErrorKind enum

    Public Enum ParseErrorKind

    What kind of ParseError it is.

    std/core/error.fb, line 114

    • SYNTAX enum member #

      Text that isn't the format.

    • UNEXPECTED_END enum member #

      Text that ends too soon.

    • WRONG_TYPE enum member #

      A value of another type than the one asked for.

    • OUT_OF_RANGE enum member #

      A number too big for its type.

    • MISSING enum member #

      A value that Load<T> needs for a Field and doesn't have.

    • OTHER enum member #

      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.

    std/core/error.fb, line 131

    • Public ReadOnly Field Kind: ParseErrorKind field #

      What kind of ParseError it is.

    • Public ReadOnly Field Line: Int field #

      The line of what was read where it went wrong, from 1, or 0 when it has no lines.

    • Public ReadOnly Field Column: Int field #

      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 kind that says message, at line and column.

    • Public Property Path: String? property #

      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.

    std/core/error.fb, line 179

    • BAD_TEMPLATE enum member #

      A template that isn't one.

    • MISSING_VALUE enum member #

      A template that names a value it isn't given.

    • BAD_VALUE enum member #

      A value its spec doesn't fit.

    • OTHER enum member #

      Something else.

    FormatError class

    Public Class FormatError Extends Error

    A template that Format can't fill.

    std/core/error.fb, line 191

    • Public ReadOnly Field Kind: FormatErrorKind field #

      What kind of FormatError it is.

    • Public New(kind: FormatErrorKind, message: String, cause: Error? = Null) constructor #

      Makes a FormatError of kind that says message.

    TimeoutError class

    Public Class TimeoutError Extends Error

    Something took longer than it was given.

    std/core/error.fb, line 203

    CancelledError class

    Public Class CancelledError Extends Error

    Work that stopped because a Cancellation said to.

    std/core/error.fb, line 207

    NetErrorKind enum

    Public Enum NetErrorKind

    What kind of NetError it is.

    std/core/error.fb, line 211

    • REFUSED enum member #

      A connection the other side refused.

    • RESET enum member #

      A connection the other side reset.

    • UNREACHABLE enum member #

      A network or host that can't be reached.

    • HOST_NOT_FOUND enum member #

      A host name that can't be found.

    • CLOSED enum member #

      A connection that's closed.

    • TLS enum member #

      TLS that failed.

    • HTTP_STATUS enum member #

      An HTTP response whose status isn't success.

    • OTHER enum member #

      Something else.

    NetError class

    Public Class NetError Extends Error

    Talking over a network failed. Address is the other side's, when there is one.

    std/core/error.fb, line 231

    • Public ReadOnly Field Kind: NetErrorKind field #

      What kind of NetError it is.

    • Public ReadOnly Field Address: String? field #

      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 kind that says message, about address.

    DatabaseErrorKind enum

    Public Enum DatabaseErrorKind

    What kind of DatabaseError it is.

    std/core/error.fb, line 247

    • CONSTRAINT enum member #

      A constraint a change breaks.

    • BUSY enum member #

      A database that another connection holds.

    • QUERY enum member #

      A query that isn't one.

    • CORRUPT enum member #

      A file that isn't a database.

    • OTHER enum member #

      Something else.

    DatabaseError class

    Public Class DatabaseError Extends Error

    A database couldn't do what it was asked.

    std/core/error.fb, line 261

    • Public ReadOnly Field Kind: DatabaseErrorKind field #

      What kind of DatabaseError it is.

    • Public New(kind: DatabaseErrorKind, message: String, cause: Error? = Null) constructor #

      Makes a DatabaseError of kind that says message.

    Report an issue with this page or with FutureBlitz on GitHub.