Skip to content
Open
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 src/graphql/error-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
// ----------
Expand Down
2 changes: 1 addition & 1 deletion src/services/storage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down