ServerFnError (@shadow-js/dusk/vite)
A problem in a server function, with the position in the file and a code frame.
A problem in a server function, with the position in the file and a code frame.
Import#
ts
import { ServerFnError } from "@shadow-js/dusk/vite";
Signature#
ts
class ServerFnError extends Error
Members#
| Name | Type | Description |
|---|---|---|
code |
readonly code: ServerFnIssueCode |
|
file |
readonly file: string |
|
line |
readonly line: number |
|
column |
readonly column: number |
|
frame |
readonly frame: string |
Examples#
ts
import { ServerFnError } from "@shadow-js/dusk/vite";
new ServerFnError("SERVER_FN_NOT_ASYNC", "a server function must be async", "src/api.ts", 3, 1, "").code; // "SERVER_FN_NOT_ASYNC"