Conditions | 3 |
Total Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # frozen_string_literal: true |
||
21 | def create(type, _data, context) |
||
22 | create_internal(type) |
||
23 | rescue StandardError => e |
||
24 | message = "Failed to instantiate #{type} directly from class" |
||
25 | if e.is_a?(ArgumentError) |
||
26 | message += '. Does it have parameterless #initialize() method?' |
||
27 | end |
||
28 | mapping_error(message, parent: e, context: context) |
||
29 | end |
||
30 | |||
49 |