JSCException: JavaScriptCore GLib Reference Manual

## JSCException JSCException — JavaScript exception |

## Functions

JSCException * | jsc_exception_new ()
JSCException * | jsc_exception_new_printf ()
JSCException * | jsc_exception_new_vprintf ()
JSCException * | jsc_exception_new_with_name ()
JSCException * | jsc_exception_new_with_name_printf ()
JSCException * | jsc_exception_new_with_name_vprintf ()
const char * | jsc_exception_get_name ()
const char * | jsc_exception_get_message ()
guint | jsc_exception_get_line_number ()
guint | jsc_exception_get_column_number ()
const char * | jsc_exception_get_source_uri ()
const char * | jsc_exception_get_backtrace_string ()
char * | jsc_exception_to_string ()
char * | jsc_exception_report ()

## Types and Values

struct | JSCException

## Object Hierarchy

        GObject
        ╰── JSCException

## Description

JSCException represents a JavaScript exception.

## Functions

### jsc_exception_new ()

    JSCException *
    jsc_exception_new (JSCContext *context,
                       const char *message);

Create a new JSCException in `context` with `message` .

#### Parameters

context | a JSCContext |
message | the error message |

#### Returns

a new JSCException.

[transfer full]

### jsc_exception_new_printf ()

    JSCException *
    jsc_exception_new_printf (JSCContext *context,
                              const char *format,
                              ...);

Create a new JSCException in `context` using a formatted string for the message.

#### Parameters

context | a JSCContext |
format | the string format |
... | the parameters to insert into the format string |

#### Returns

a new JSCException.

[transfer full]

### jsc_exception_new_vprintf ()

    JSCException *
    jsc_exception_new_vprintf (JSCContext *context,
                               const char *format,
                               va_list args);

Create a new JSCException in `context` using a formatted string for the message. This is similar to `jsc_exception_new_printf()` except that the arguments to the format string are passed as a va_list.

#### Parameters

context | a JSCContext |
format | the string format |
args | the parameters to insert into the format string |

#### Returns

a new JSCException.

[transfer full]

### jsc_exception_new_with_name ()

    JSCException *
    jsc_exception_new_with_name (JSCContext *context,
                                 const char *name,
                                 const char *message);

Create a new JSCException in `context` with `name` and `message` .

#### Parameters

context | a JSCContext |
name | the error name |
message | the error message |

#### Returns

a new JSCException.

[transfer full]

### jsc_exception_new_with_name_printf ()

    JSCException *
    jsc_exception_new_with_name_printf (JSCContext *context,
                                        const char *name,
                                        const char *format,
                                        ...);

Create a new JSCException in `context` with `name` and using a formatted string for the message.

#### Parameters

context | a JSCContext |
name | the error name |
format | the string format |
... | the parameters to insert into the format string |

#### Returns

a new JSCException.

[transfer full]

### jsc_exception_new_with_name_vprintf ()

    JSCException *
    jsc_exception_new_with_name_vprintf (JSCContext *context,
                                         const char *name,
                                         const char *format,
                                         va_list args);

Create a new JSCException in `context` with `name` and using a formatted string for the message. This is similar to `jsc_exception_new_with_name_printf()` except that the arguments to the format string are passed as a va_list.

#### Parameters

context | a JSCContext |
name | the error name |
format | the string format |
args | the parameters to insert into the format string |

#### Returns

a new JSCException.

[transfer full]

### jsc_exception_get_name ()

    const char *
    jsc_exception_get_name (JSCException *exception);

Get the error name of `exception`

#### Parameters

exception | a JSCException |

#### Returns

the `exception` error name.

### jsc_exception_get_message ()

    const char *
    jsc_exception_get_message (JSCException *exception);

Get the error message of `exception` .

#### Parameters

exception | a JSCException |

#### Returns

the `exception` error message.

### jsc_exception_get_line_number ()

    guint
    jsc_exception_get_line_number (JSCException *exception);

Get the line number at which `exception` happened.

#### Parameters

exception | a JSCException |

#### Returns

the line number of `exception` .

### jsc_exception_get_column_number ()

    guint
    jsc_exception_get_column_number (JSCException *exception);

Get the column number at which `exception` happened.

#### Parameters

exception | a JSCException |

#### Returns

the column number of `exception` .

### jsc_exception_get_source_uri ()

    const char *
    jsc_exception_get_source_uri (JSCException *exception);

Get the source URI of `exception` .

#### Parameters

exception | a JSCException |

#### Returns

the the source URI of `exception` , or `NULL`.

[nullable]

### jsc_exception_get_backtrace_string ()

    const char *
    jsc_exception_get_backtrace_string (JSCException *exception);

Get a string with the exception backtrace.

#### Parameters

exception | a JSCException |

#### Returns

the exception backtrace string or `NULL`.

[nullable]

### jsc_exception_to_string ()

    char *
    jsc_exception_to_string (JSCException *exception);

Get the string representation of `exception` error.

#### Parameters

exception | a JSCException |

#### Returns

the string representation of `exception` .

[transfer full]

### jsc_exception_report ()

    char *
    jsc_exception_report (JSCException *exception);

Return a report message of `exception` , containing all the possible details such us source URI, line, column and backtrace, and formatted to be printed.

#### Parameters

exception | a JSCException |

#### Returns

a new string with the exception report.

[transfer full]

## Types and Values

### struct JSCException

    struct JSCException;

## See Also

JSCContext