---
name: "JavaScript::Error"
section: "3pm"
platform: "linux"
package: "libjavascript-perl"
version: "1.16-3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/JavaScript::Error"
---

# JavaScript::Error(3pm)

Encapsulates errors thrown from JavaScript

## NAME

JavaScript::Error - Encapsulates errors thrown from JavaScript

## INTERFACE

### INSTANCE METHODS

- message

  The cause of the exception.

- file

  The name of the file that the caused the exception.

- line

  The line number in the file that caused the exception.

- as\_string

  A stringification of the exception in the format `"$message at $line in $file"`

- stacktrace

  Returns the stacktrace for the exception as a list of hashrefs containing `"function"`, `"file"` and `"lineno"`.

## OVERLOADED OPERATIONS

This class overloads stringification an will return the result from the method `"as_string"`.
