class StoragePresignNotSupported
extends Error

Error thrown when attempting to use presign on an adapter that does not support presigned URLs.

Examples

Checking for presign support

import { Storage, createMemory, StoragePresignNotSupported } from "@anabranch/storage";

const storage = await Storage.connect(createMemory()).run();

try {
  const url = await storage.presign("file.txt", { expiresIn: 3600 }).run();
  console.log(url);
} catch (error) {
  if (error instanceof StoragePresignNotSupported) {
    console.log("Presigned URLs not supported by this adapter");
  }
}

Constructors

new
StoragePresignNotSupported()

Properties

name: string

Usage

import { StoragePresignNotSupported } from ".";