| Total Complexity | 3 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | module Koine |
||
| 3 | class InvalidAttributeError < ::ArgumentError |
||
| 4 | attr_reader :attribute_name |
||
| 5 | |||
| 6 | def initialize(error, attribute_name) |
||
| 7 | @attribute_name = attribute_name |
||
| 8 | |||
| 9 | if error.is_a?(Exception) |
||
| 10 | set_backtrace(error.backtrace) |
||
| 11 | error = error.message |
||
| 12 | end |
||
| 13 | |||
| 14 | error = "#{attribute_name}: #{error}" if attribute_name |
||
| 15 | |||
| 16 | super(error) |
||
| 17 | end |
||
| 18 | end |
||
| 19 | end |
||
| 21 |