Format
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
* Do not import at config time.
|
||||
*/
|
||||
|
||||
import { createRemoteJWKSet, jwtVerify, type JWTPayload } from "jose";
|
||||
import type { AuthResult } from "emdash";
|
||||
import { createRemoteJWKSet, jwtVerify, type JWTPayload } from "jose";
|
||||
|
||||
/**
|
||||
* Configuration for Cloudflare Access authentication
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
import type { MiddlewareHandler } from "astro";
|
||||
import { env } from "cloudflare:workers";
|
||||
import { Kysely } from "kysely";
|
||||
import { runWithContext } from "emdash/request-context";
|
||||
import { Kysely } from "kysely";
|
||||
import { ulid } from "ulidx";
|
||||
|
||||
import type { EmDashPreviewDB } from "./do-class.js";
|
||||
|
||||
@@ -61,11 +61,7 @@ export class R2Storage implements Storage {
|
||||
};
|
||||
} catch (error) {
|
||||
if (error instanceof EmDashStorageError) throw error;
|
||||
throw new EmDashStorageError(
|
||||
`Failed to upload file: ${options.key}`,
|
||||
"UPLOAD_FAILED",
|
||||
error,
|
||||
);
|
||||
throw new EmDashStorageError(`Failed to upload file: ${options.key}`, "UPLOAD_FAILED", error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,11 +103,7 @@ export class R2Storage implements Storage {
|
||||
const object = await this.bucket.head(key);
|
||||
return object !== null;
|
||||
} catch (error) {
|
||||
throw new EmDashStorageError(
|
||||
`Failed to check file existence: ${key}`,
|
||||
"HEAD_FAILED",
|
||||
error,
|
||||
);
|
||||
throw new EmDashStorageError(`Failed to check file existence: ${key}`, "HEAD_FAILED", error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user