diff --git a/app/action.rb b/app/action.rb index 2c7ab02..bba2581 100644 --- a/app/action.rb +++ b/app/action.rb @@ -3,11 +3,17 @@ require "hanami/action" require "httparty" +require "dry-monads" +require "dry-matcher" +require "dry/matcher/result_matcher" module Adamantium class Action < Hanami::Action include Deps["logger", "settings", not_found_view: "views.not_found"] + include Dry::Matcher.for(:handle, with: Dry::Matcher::ResultMatcher) + include Dry::Monads[:result] + handle_exception ROM::TupleCountMismatchError => :not_found def authenticate!(req, res)