Skip to content

Commit 9cac420

Browse files
authored
Improve static assets otp_app error message (#305)
Previously it wasn't possible to know the specific error message which could potentially cover up other error messages. Also knowing the value that was tried gives a good hint about if you are setting the value in your configuration in the right place.
1 parent 759e9d7 commit 9cac420

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/scenic/assets/static.ex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,12 @@ defmodule Scenic.Assets.Static do
451451
|> :code.lib_dir()
452452
|> Path.join(Static.dst_dir())
453453
rescue
454-
_ ->
455-
raise """
456-
'use Scenic.Assets.Static' requires a valid :otp_app option.
457-
"""
454+
e ->
455+
Logger.warn(
456+
"'use Scenic.Assets.Static' requires a valid :otp_app option. Received otp_app #{opts[:otp_app]}"
457+
)
458+
459+
reraise e, __STACKTRACE__
458460
end
459461

460462
# make sure the destination directory exists (delete and recreate to keep it clean)

0 commit comments

Comments
 (0)