Files
wanderer/lib/wanderer_app.ex
Dmitry Popov 696c7d2cd1 Map events refactoring (#41)
* refactor(Map): Map event handling refactoring
2024-11-01 14:54:34 +04:00

51 lines
986 B
Elixir

defmodule WandererApp do
@moduledoc """
WandererApp keeps the contexts that define your domain
and business logic.
Contexts are also responsible for managing your data, regardless
if it comes from the database, an external API or others.
"""
require Logger
@doc """
When used, dispatch to the appropriate domain service
"""
def domain_service do
quote do
end
end
def application_service do
quote do
end
end
def repository do
quote do
end
end
def check(), do: {:ok, :ok}
defmacro __using__(which) when is_atom(which) do
apply(__MODULE__, which, [])
end
def log_exception(kind, reason, stacktrace) do
reason = Exception.normalize(kind, reason, stacktrace)
crash_reason =
case kind do
:throw -> {{:nocatch, reason}, stacktrace}
_ -> {reason, stacktrace}
end
Logger.error(
Exception.format(kind, reason, stacktrace),
crash_reason: crash_reason
)
end
end