Skip to main content
Version: v0.1.0

Error codes

PointFlow uses a typed error class with stable codes. Catch it anywhere you handle load or ingest failures.

import { PointFlowError } from "pointflow";

PointFlowError

class PointFlowError extends Error {
readonly code: PointFlowErrorCode;
}

Error codes

CodeWhen it occurs
PF_ABORTEDA load was cancelled via abort().
PF_PARSE_FAILEDThe file couldn't be parsed. Malformed header, corrupt data, or unsupported variant.
PF_UNSUPPORTED_FORMATThe file extension or magic bytes aren't recognized.
PF_INVALID_SOURCEsrc is null, undefined, or an unresolvable value.
PF_WORKER_INIT_FAILEDThe ingest or loader Web Worker failed to start. Usually a CSP or environment issue.
PF_NETWORK_RANGE_UNAVAILABLEAn HTTP range request was denied by the server. Needed for COPC tile fetching.

Handling errors

<PointCloud
src={src}
onError={(err) => {
if (err.code === "PF_ABORTED") {
// user cancelled, not an error to report
return;
}
if (err.code === "PF_UNSUPPORTED_FORMAT") {
showToast("That file format isn't supported. Try PLY, XYZ, LAS, or LAZ.");
return;
}
// unexpected error
reportError(err);
}}
/>

Checking for PointFlowError

import { PointFlowError } from "pointflow";

function isPointFlowError(err: unknown): err is PointFlowError {
return err instanceof PointFlowError;
}

Worker errors

PF_WORKER_INIT_FAILED is the most common error in restricted environments. It fires when the browser blocks Worker creation, which happens under strict Content Security Policy settings. Adding worker-src 'self' blob: to your CSP usually fixes it.