Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dmihalcik-virtru committed Oct 14, 2024
1 parent 0f4a3c4 commit 3e5b90a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 12 additions & 1 deletion lib/src/access.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { type AuthProvider } from './auth/auth.js';
import { NetworkError, PermissionDeniedError, ServiceError, TdfError, UnauthenticatedError } from './errors.js';
import {
InvalidFileError,
NetworkError,
PermissionDeniedError,
ServiceError,
TdfError,
UnauthenticatedError,
} from './errors.js';
import { pemToCryptoPublicKey, validateSecureUrl } from './utils.js';

export class RewrapRequest {
Expand Down Expand Up @@ -48,6 +55,10 @@ export async function fetchWrappedKey(

if (!response.ok) {
switch (response.status) {
case 400:
throw new InvalidFileError(
`400 for [${req.url}]: rewrap failure [${await response.text()}]`
);
case 401:
throw new UnauthenticatedError(`401 for [${req.url}]`);
case 403:
Expand Down
1 change: 0 additions & 1 deletion lib/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export class TdfError extends Error {
}
}


/**
* Errors that indicate the client or method does not have valid options.
*/
Expand Down

0 comments on commit 3e5b90a

Please sign in to comment.