appengine
appengine copied to clipboard
Provide a assets.fileExists() function or make assets.serve() throw
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:
- an
assets.fileExists()function, so I can check if the file exists - a way to call
assets.serve()so it throws an exception instead of responding with404itself.
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.