Bypass provides a quick way to create a custom plug that can be put in place instead of an actual HTTP server to return prebaked responses to client requests.
According to comment https://github.com/PSPDFKit-labs/bypass/pull/92#issuecomment-638101755 bypass takes the approach of trying to crash during the startup to avoid adding to the user the burden to handle errors. However the open/1 function returns an error tuple in case any problem happens during the process start.
Motivation
According to comment https://github.com/PSPDFKit-labs/bypass/pull/92#issuecomment-638101755 bypass takes the approach of trying to crash during the startup to avoid adding to the user the burden to handle errors. However the
open/1
function returns an error tuple in case any problem happens during the process start.Proposed solution
Based on the
start_supervised!/2
function from ex_unit, https://github.com/elixir-lang/elixir/blob/master/lib/ex_unit/lib/ex_unit/callbacks.ex#L424, raise an exception in case any error happens when starting the bypass process atBypass.open/1
.