Skip to content
Draft
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
31 changes: 17 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"netmask": "^2.0.2",
"node-tunnel": "^4.0.8",
"p-timeout": "^7.0.0",
"pinejs-client-request": "^8.1.0",
"pinejs-client-fetch": "^2.0.4",
"request": "^2.88.2",
"request-promise": "^4.2.6",
"split": "^1.0.1",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { optionalVar } from '@balena/env-parsing';
import memoize from 'memoizee';

import { balenaApi, getPassthrough, StatusError } from './index.js';
import { balenaApi, getPassthrough, RequestError } from './index.js';
import { APIError, captureException } from './errors.js';

const VPN_GUEST_API_KEY = optionalVar('VPN_GUEST_API_KEY');
Expand Down Expand Up @@ -123,7 +123,7 @@ export const getDeviceVpnHost = async (
});
return services[0];
} catch (err) {
if (!(err instanceof StatusError) || err.statusCode !== 401) {
if (!(err instanceof RequestError) || err.status !== 401) {
// Do not capture `Unauthorized` errors
captureException(err, 'device-vpn-host-lookup-error');
}
Expand Down
6 changes: 3 additions & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@

import winston from 'winston';

import { PinejsClientRequest } from 'pinejs-client-request';
export { StatusError } from 'pinejs-client-request';
import PinejsClientFetch from 'pinejs-client-fetch';
export { RequestError } from 'pinejs-client-fetch';
import { BALENA_API_INTERNAL_HOST } from './config.js';
import type { PineClient as BalenaPineClient } from 'balena-sdk';

import packageJSON from '../../package.json' with { type: 'json' };
import { context, propagation } from '@opentelemetry/api';
export const VERSION = packageJSON.version;

export const balenaApi = new PinejsClientRequest({
export const balenaApi = new PinejsClientFetch({
apiPrefix: `${BALENA_API_INTERNAL_HOST}/v7/`,
}) satisfies BalenaPineClient as BalenaPineClient;

Expand Down
Loading