diff --git a/src/graphql/error-map.ts b/src/graphql/error-map.ts index 06ff7be12..d71176a3f 100644 --- a/src/graphql/error-map.ts +++ b/src/graphql/error-map.ts @@ -465,6 +465,14 @@ export const mapError = (error: ApplicationError): CustomApolloError => { message: "Offer not available. Try again.", logger: baseLogger }) + case "StorageError": + message = error.message + return new UnexpectedClientError({ message, logger: baseLogger }) + + case "InvalidFileTypeError": + message = error.message + return new ValidationInternalError({ message, logger: baseLogger }) + // ---------- // Unhandled below here // ---------- diff --git a/src/services/storage/index.ts b/src/services/storage/index.ts index c25306834..b1db34211 100644 --- a/src/services/storage/index.ts +++ b/src/services/storage/index.ts @@ -13,7 +13,7 @@ import { ErrorLevel } from "@domain/shared" import { InvalidFileTypeError, StorageError } from "./errors" -const ALLOWED_CONTENT_TYPES = ["image/jpeg", "image/png", "image/webp"] as const +const ALLOWED_CONTENT_TYPES = ["image/jpeg", "image/png", "image/webp", "image/heic"] as const const UPLOAD_URL_EXPIRY_SECONDS = 15 * 60 // 15 minutes const READ_URL_EXPIRY_SECONDS = 60 * 60 // 1 hour