perspective-dev/perspective · error · PerspectiveException
throw PerspectiveException(message.c_str())
Error message
throw PerspectiveException(message.c_str())
What it means
`psp_abort` is Perspective's central C++ abort hook: it takes a message and throws `PerspectiveException(message.c_str())`, a custom C++ exception type. Any fatal internal condition in the Perspective engine (server or WASM) funnels through this function, so the message you see is the engine's description of the invariant or input that failed. In practice this surfaces to clients as an opaque 'PerspectiveException: <message>' error.
Solutions
- Read the exception message text — it names the specific engine invariant or input that failed
- Verify client (perspective-js/python) and server versions match — cross-version protocol mismatches commonly abort the engine
- Validate the input data schema/types before sending to the server (e.g. Arrow table dtypes)
- If the message indicates an internal invariant with valid inputs, report it with a reproduction to the perspective-dev maintainers
Example fix
// before
await table.view({ columns: ["typo_column"] }); // engine aborts on unknown column
// after
const cols = table.schema();
if (!("typo_column" in cols)) throw new Error("column not found");
await table.view({ columns: ["typo_column"] }); Defensive patterns
Strategy: try-catch
Validate before calling
// validate inputs before sending to the engine
const schema = table.schema();
for (const col of columns) {
if (!(col in schema)) throw new Error(`unknown column: ${col}`);
} Try / catch
try {
const view = await table.view({ columns });
} catch (e) {
if (String(e).includes("PerspectiveException")) {
console.error("engine abort:", e.message);
// fall back to rebuilding the table from source data
}
} Prevention
- Match client and server versions exactly
- Validate data schema/dtypes before sending to the engine
- Keep parent tables alive while views exist
- Report unexpected PerspectiveException messages with a reproduction
When it happens
Trigger: Any code path in the C++ engine calling `psp_abort(<message>)` — e.g. on invalid data types, corrupted internal state, or violated invariants during table/view/computed-column operations; the exact condition is carried in the thrown message.
Common situations: Passing Arrow data with an unsupported schema, operations on a table/view that has been removed server-side, engine bugs or platform-specific issues in the compiled perspective-server, or mixing incompatible client/server versions.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
AI-assisted analysis of perspective-dev/perspective@11c8238c0c (2026-09-09).
Data as JSON: /api/errors/37d8b79b80ae012e.
Report an issue: GitHub.
Appendix: source
Thrown at rust/perspective-server/cpp/perspective/src/cpp/base.cpp:23
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
// ┃ This file is part of the Perspective library, distributed under the terms ┃
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
#include <perspective/first.h>
#include <perspective/base.h>
#include <cstdint>
#include <limits>
#include <perspective/exception.h>
namespace perspective {
void
psp_abort(const std::string& message) {
throw PerspectiveException(message.c_str());
}
bool
is_numeric_type(t_dtype dtype) {
switch (dtype) {
case DTYPE_UINT8:
case DTYPE_UINT16:
case DTYPE_UINT32:
case DTYPE_UINT64:
case DTYPE_INT8:
case DTYPE_INT16:
case DTYPE_INT32:
case DTYPE_INT64:
case DTYPE_FLOAT32:
case DTYPE_FLOAT64: {
return true;
} break;
default: {View on GitHub (pinned to 11c8238c0c)