Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

> Entries before 1.2.0 were not tracked in this file; see the git history for details.

## [1.4.1] — 2026-08-14
### Fixed
- Non-JSON error bodies (e.g. a plain-text `"Service Unavailable"` on a FAMIS 503) no
longer crash requests with a raw `SyntaxError`/`"... is not valid JSON"`. The shared
axios instance now parses defensively and falls back to the raw string, so
`throwResponseError`/`ApiError` always get a real response to work with instead of
axios's transform throwing before one exists. (#458)

## [1.4.0] — 2026-07-17
### Added
- Opt-in **keyset (Id-range-partitioned) parallel paging** for the assets batch fetch.
Expand Down
18 changes: 18 additions & 0 deletions famis_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,24 @@ export class FamisClient {
// socket, freeing the slot) instead of hanging forever. Per-request, not
// per-operation — safe for paginated fetches (each page is its own request).
timeout: requestTimeoutMs,
// FAMIS sometimes returns a non-JSON body (e.g. plain-text "Service Unavailable")
// on 5xx errors. Axios's default transformResponse can throw a raw SyntaxError in
// that case instead of resolving, which skips throwResponseError entirely and
// surfaces an unhandled parse error instead of a clean ApiError with the real
// status. Parse defensively and fall back to the raw string so every request
// resolves to a normal AxiosResponse.
transformResponse: [
(data: any) => {
if (typeof data === 'string' && data.length) {
try {
return JSON.parse(data);
} catch (e) {
return data;
}
}
return data;
},
],
});
if (autoRetry) {
const RETRIES = 6;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "facility360",
"version": "1.4.0",
"version": "1.4.1",
"description": "A Node based 360Facility client SDK",
"main": "dist/index.js",
"files": [
Expand Down
Loading