kagux / ex_debug_toolbar

A debug web toolbar for Phoenix projects to display all sorts of information about request

Home Page:https://hex.pm/packages/ex_debug_toolbar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toolbar.record_event/2 does not pass through callback result when toolbar is disabled

kagux opened this issue · comments

When toolbar is disabled with the rest of installation configs in place (templates in this case), it raises on template render:

Request: GET /
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Phoenix.Template.HTML.encode_to_iodata!/1
        (phoenix) lib/phoenix/template/html.ex:12: Phoenix.Template.HTML.encode_to_iodata!({:error, :toolbar_disabled})
        (sylar) lib/sylar/endpoint.ex:1: Sylar.Endpoint.instrument/4
        (phoenix) lib/phoenix/controller.ex:646: Phoenix.Controller.do_render/4
        (sylar) web/controllers/home_controller.ex:1: Sylar.HomeController.action/2
        (sylar) web/controllers/home_controller.ex:1: Sylar.HomeController.phoenix_controller_pipeline/2
        (sylar) lib/sylar/endpoint.ex:1: Sylar.Endpoint.instrument/4
        (sylar) lib/phoenix/router.ex:261: Sylar.Router.dispatch/2
        (sylar) web/router.ex:1: Sylar.Router.do_call/2
        (sylar) lib/sylar/endpoint.ex:1: Sylar.Endpoint.phoenix_pipeline/1
        (sylar) lib/sylar/endpoint.ex:42: Sylar.Endpoint."call (overridable 2)"/2
        (sylar) lib/sylar/endpoint.ex:42: Sylar.Endpoint."call (overridable 3)"/2
        (sylar) lib/plug/debugger.ex:123: Sylar.Endpoint."call (overridable 4)"/2
        (sylar) lib/sylar/endpoint.ex:1: Sylar.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) /Users/bmikhayl/Projects/sylar/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4