In #1611, we added API allowing app developers to serve static assets from their applications. The implementation was focused on enabling the happy path (serve a file that exists and can be fully read) but neglected error handling.
When a static asset is not found and/or cannot not be read, the reject error handler is not invoked and a very bare-bone fallback handler is used instead.
https://github.com/strongloop/loopback-next/blob/0364b59409ce3691babf5f17b5cd444b4e7f72aa/packages/rest/src/rest.server.ts#L654-L666
Let's find a way that enables LB4 app developers to control the error responses for static assets (and any non-API routes in general).
In #1611, we added API allowing app developers to serve static assets from their applications. The implementation was focused on enabling the happy path (serve a file that exists and can be fully read) but neglected error handling.
When a static asset is not found and/or cannot not be read, the
rejecterror handler is not invoked and a very bare-bone fallback handler is used instead.https://github.com/strongloop/loopback-next/blob/0364b59409ce3691babf5f17b5cd444b4e7f72aa/packages/rest/src/rest.server.ts#L654-L666
Let's find a way that enables LB4 app developers to control the error responses for static assets (and any non-API routes in general).