Class (GI Struct)

GLib-2.0GLibRegexErrorSince 2.14

Error codes returned by regular expressions functions.

Hierarchy (View Summary)

Index

Constructors

Properties

$gtype: GType<GLib.Error>
ASSERTION_EXPECTED: number

Assertion expected after "(?(". Since 2.16

BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN: number

the backtracing control verb used does not allow an argument. Since: 2.34

BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED: number

the backtracing control verb requires an argument. Since: 2.34

CHARACTER_VALUE_TOO_LARGE: number

the character value in the \u sequence is too large. Since: 2.34

COMPILE: number

Compilation of the regular expression failed.

DEFINE_REPETION: number

Repeating a "DEFINE" group is not allowed. This error is never raised. Since: 2.16 Deprecated: 2.34

DUPLICATE_SUBPATTERN_NAME: number

Two named subpatterns have the same name. Since 2.16

EXPRESSION_TOO_LARGE: number

Regular expression too large. Since 2.16

EXTRA_SUBPATTERN_NAME: number

different names for subpatterns of the same number are not allowed. Since: 2.34

HEX_CODE_TOO_LARGE: number

Character value in "\x{...}" sequence is too large. Since 2.16

INCONSISTENT_NEWLINE_OPTIONS: number

Inconsistent newline options. Since 2.16

INEXISTENT_SUBPATTERN_REFERENCE: number

Reference to non-existent subpattern. Since 2.16

INFINITE_LOOP: number

Recursive call could loop indefinitely. Since 2.16

INTERNAL: number

Internal error of the regular expression engine. Since 2.16

INVALID_CONDITION: number

Invalid condition "(?(0)". Since 2.16

INVALID_CONTROL_CHAR: number

"\c" must be followed by an ASCII character. Since: 2.34

INVALID_DATA_CHARACTER: number

In JavaScript compatibility mode, "[" is an invalid data character. Since: 2.34

INVALID_ESCAPE_IN_CHARACTER_CLASS: number

Invalid escape sequence in character class. Since 2.16

INVALID_OCTAL_VALUE: number

Octal value is greater than "\377". Since 2.16

INVALID_RELATIVE_REFERENCE: number

relative reference must not be zero. Since: 2.34

MALFORMED_CONDITION: number

Malformed number or name after "(?(". Since 2.16

MALFORMED_PROPERTY: number

Malformed "\P" or "\p" sequence. Since 2.16

MATCH: number

The match process failed.

MEMORY_ERROR: number

Failed to get memory. Since 2.16

MISSING_BACK_REFERENCE: number

"\g" is not followed by a braced, angle-bracketed, or quoted name or number, or by a plain number. Since: 2.16

MISSING_CONTROL_CHAR: number

"\c" at end of pattern. Since 2.16

MISSING_DIGIT: number

Missing digit. Since 2.34

MISSING_NAME: number

"\k" is not followed by a braced, angle-bracketed, or quoted name. Since: 2.34

MISSING_SUBPATTERN_NAME: number

Missing subpattern name. Since: 2.34

MISSING_SUBPATTERN_NAME_TERMINATOR: number

Missing terminator in subpattern name. Since 2.16

NAME_TOO_LONG: number

the name is too long in "(*MARK)", "(*PRUNE)", "(*SKIP)", or "(*THEN)". Since: 2.34

NOT_SUPPORTED_IN_CLASS: number

"\N" is not supported in a class. Since: 2.34

NOTHING_TO_REPEAT: number

Nothing to repeat. Since 2.16

NUMBER_TOO_BIG: number

number is too big in escape sequence. Since: 2.34

OPTIMIZE: number

Optimization of the regular expression failed.

POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED: number

POSIX collating elements are not supported. Since 2.16

POSIX_NAMED_CLASS_OUTSIDE_CLASS: number

POSIX named classes are supported only within a class. Since 2.16

QUANTIFIER_TOO_BIG: number

Number too big in "{}" quantifier. Since 2.16

QUANTIFIERS_OUT_OF_ORDER: number

Numbers out of order in "{}" quantifier. Since 2.16

RANGE_OUT_OF_ORDER: number

Range out of order in character class. Since 2.16

REPLACE: number

Replacement failed due to an ill-formed replacement string.

SINGLE_BYTE_MATCH_IN_LOOKBEHIND: number

\C not allowed in lookbehind assertion. Since 2.16

STRAY_BACKSLASH: number

"\" at end of pattern. Since 2.16

SUBPATTERN_NAME_TOO_LONG: number

Subpattern name is too long (maximum 32 characters). Since 2.16

TOO_MANY_BRANCHES_IN_DEFINE: number

"DEFINE" group contains more than one branch. Since 2.16

TOO_MANY_CONDITIONAL_BRANCHES: number

Conditional group contains more than two branches. Since 2.16

TOO_MANY_FORWARD_REFERENCES: number

too many forward references. Since: 2.34

TOO_MANY_SUBPATTERNS: number

Too many named subpatterns (maximum 10,000). Since 2.16

UNKNOWN_BACKTRACKING_CONTROL_VERB: number

unknown backtracing control verb. Since: 2.34

UNKNOWN_POSIX_CLASS_NAME: number

Unknown POSIX class name. Since 2.16

UNKNOWN_PROPERTY: number

Unknown property name after "\P" or "\p". Since 2.16

UNMATCHED_PARENTHESIS: number

Missing terminating ")" or ")" without opening "(". Since 2.16

UNRECOGNIZED_CHARACTER: number

Unrecognized character after "(?", "(?<" or "(?P". Since 2.16

UNRECOGNIZED_ESCAPE: number

Unrecognized character follows "\". Since 2.16

UNTERMINATED_CHARACTER_CLASS: number

Missing terminating "]" for character class. Since 2.16

UNTERMINATED_COMMENT: number

Missing terminating ")" after comment. Since 2.16

VARIABLE_LENGTH_LOOKBEHIND: number

Lookbehind assertion is not fixed length. Since 2.16

Properties - Inherited from GLib.Error

code: number
domain: number
message: string
stack: string

Methods - Inherited from GLib.Error

  • Returns true if error matches domain and code, false otherwise. In particular, when error is null, false will be returned.

    If domain contains a FAILED (or otherwise generic) error code, you should generally not check for it explicitly, but should instead treat any not-explicitly-recognized error code as being equivalent to the FAILED code. This way, if the domain is extended in the future to provide a more specific error code for a certain case, your code will still work.

    Parameters

    • domain: number | (new (...args: any[]) => GLib.Error)

      an error domain

    • code: number

      an error code

    Returns boolean

    whether error has domain and code

  • This function registers an extended GLib.Error domain. error_type_name will be duplicated. Otherwise does the same as g_error_domain_register_static().

    Parameters

    • error_type_name: string

      string to create a GLib.Quark from

    • error_type_private_size: number

      size of the private error data in bytes

    • error_type_init: ErrorInitFunc

      function initializing fields of the private error data

    • error_type_copy: ErrorCopyFunc

      function copying fields of the private error data

    • error_type_clear: ErrorClearFunc

      function freeing fields of the private error data

    Returns number

  • This function registers an extended GLib.Error domain.

    error_type_name should not be freed. error_type_private_size must be greater than 0.

    error_type_init receives an initialized GLib.Error and should then initialize the private data.

    error_type_copy is a function that receives both original and a copy GLib.Error and should copy the fields of the private error data. The standard GLib.Error fields are already handled.

    error_type_clear receives the pointer to the error, and it should free the fields of the private error data. It should not free the struct itself though.

    Normally, it is better to use G_DEFINE_EXTENDED_ERROR(), as it already takes care of passing valid information to this function.

    Parameters

    • error_type_name: string

      static string to create a GLib.Quark from

    • error_type_private_size: number

      size of the private error data in bytes

    • error_type_init: ErrorInitFunc

      function initializing fields of the private error data

    • error_type_copy: ErrorCopyFunc

      function copying fields of the private error data

    • error_type_clear: ErrorClearFunc

      function freeing fields of the private error data

    Returns number