9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/ree_lib/packages/ree_roda/package/ree_roda/services/build_route_errors.rb', line 9
def call(route)
ree_object = route.action
errors = (ree_object)
errors
.select {
_1.ancestors.include?(ReeErrors::Error) && status_from_error(_1)
}
.map {
e = _1.new
description = "type: **#{e.type}**, code: **#{e.code}**, message: **#{e.message}**"
ErrorDto.new(
status: status_from_error(_1),
description: description
)
}
.uniq { [_1.status, _1.description] }
end
|