File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77require 'jsonapi_errors_handler/error_serializer'
88
99module JsonapiErrorsHandler
10+ PREDEFINED_HASH = {
11+ 'JsonapiErrorsHandler::Errors::Invalid' =>
12+ 'JsonapiErrorsHandler::Errors::Invalid' ,
13+ 'JsonapiErrorsHandler::Errors::Forbidden' =>
14+ 'JsonapiErrorsHandler::Errors::Forbidden' ,
15+ 'JsonapiErrorsHandler::Errors::NotFound' => '
16+ JsonapiErrorsHandler::Errors::NotFound' ,
17+ 'JsonapiErrorsHandler::Errors::Unauthorized' =>
18+ 'JsonapiErrorsHandler::Errors::Unauthorized'
19+ } . freeze
20+
1021 def self . included ( base )
1122 base . class_eval do
12- ErrorMapper . map_errors! (
13- 'JsonapiErrorsHandler::Errors::Invalid' => 'JsonapiErrorsHandler::Errors::Invalid' ,
14- 'JsonapiErrorsHandler::Errors::Forbidden' => 'JsonapiErrorsHandler::Errors::Forbidden' ,
15- 'JsonapiErrorsHandler::Errors::NotFound' => 'JsonapiErrorsHandler::Errors::NotFound' ,
16- 'JsonapiErrorsHandler::Errors::Unauthorized' => 'JsonapiErrorsHandler::Errors::Unauthorized'
17- )
23+ ErrorMapper . map_errors! ( PREDEFINED_HASH )
1824 end
1925 end
2026
You can’t perform that action at this time.
0 commit comments