Skip to content

Provide a assets.fileExists() function or make assets.serve() throw #137

Open
@enyo

Description

@enyo

I want to render my own 404 pages, but Assets doesn't give me a clean way to do that.

It would be great if one of those could be implemented:

  1. an assets.fileExists() function, so I can check if the file exists
  2. a way to call assets.serve() so it throws an exception instead of responding with 404 itself.

What I'm doing to get this working is:

try {
  await gae.context.assets.read();
  gae.context.assets.serve();
}
on gae.AssetError {
  // Render my own 404 page
}

which obviously is less than ideal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions