Currently when you do error scaffolding amber g error these files are created:
11:54:26 Generate | Rendering Error Template
11:54:26 Generate | new src/views/error/not_found.slang
11:54:26 Generate | new src/views/error/internal_server_error.slang
11:54:26 Generate | new src/views/error/forbidden.slang
11:54:26 Generate | new src/handlers/error.cr
11:54:26 Generate | new src/controllers/error_controller.cr
11:54:26 Generate | new spec/controllers/error_controller_spec.cr
11:54:26 Generate | new spec/controllers/spec_helper.cr
but src/handlers/error.cr is doen't work because config/application.cr doen't require it
amber new projectcd project && shardsamber g erroramber watchExpected behavior: See 404 template working
Actual behavior: 404 Plain text page is shown instead
Reproduces how often: 100%
v0.6.3
The fix would consist in adding config/+application.cr to error template generator, but how can I add it just after the last require?
@faustinoaq There is a helper to add required dependencies. I will add a PR.
@faustinoaq do we want to move handlers to pipes?
@faustinoaq do we want to move handlers to pipes?
I don't know, maybe we can keep using handlers, see: https://github.com/amberframework/amber/issues/420
Most helpful comment
@faustinoaq There is a helper to add required dependencies. I will add a PR.