Skip to content

@alex.garcia/libfec / FecError

Class: FecError ​

Defined in: errors.ts:23

Base class of every error this package raises about a filing. code says which kind:

codeWhen
FEC_PARSEFecParseError: the header, cover or a row can't be parsed
FEC_MISSING_MAPPINGMissingMappingError: no column mapping for a row type
ERR_FILING_CLOSEDreading a Filing after close()
ERR_FILING_NOT_FOUNDFiling.fromId: docquery has no such filing (HTTP 404); status is set
ERR_HTTPFiling.fromId: any other non-2xx response; status is set

A missing or unreadable path is not a FecError: it throws the same error Node's fs.openSync would (code: "ENOENT", path, syscall: "open"). Nor is a network failure: Filing.fromId and rss.fetch let the runtime's fetch() error through, except that a browser's CORS block becomes a TypeError with code: "ERR_CORS" that explains it.

Extends ​

  • Error

Extended by ​

Constructors ​

Constructor ​

new FecError(message, options?): FecError

Defined in: errors.ts:29

Parameters ​

message ​

string

options? ​
code? ​

string

status? ​

number

cause? ​

unknown

Returns ​

FecError

Overrides ​

Error.constructor

Properties ​

code? ​

optional code?: string

Defined in: errors.ts:25

What went wrong; see the table above.


status? ​

optional status?: number

Defined in: errors.ts:27

The HTTP status, for ERR_FILING_NOT_FOUND and ERR_HTTP.