appengine icon indicating copy to clipboard operation
appengine copied to clipboard

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

Open enyo opened this issue 10 years ago • 2 comments

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.

enyo avatar Aug 10 '15 14:08 enyo