-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from belousovAV/21-expose-mapper-location
Expose failed mapper location
- Loading branch information
Showing
28 changed files
with
321 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ree_lib/lib/ree_lib/packages/ree_mapper/package/ree_mapper/errors/coercion_error.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class ReeMapper::CoercionError < ReeMapper::Error | ||
class ReeMapper::CoercionError < ReeMapper::ErrorWithLocation | ||
end |
25 changes: 25 additions & 0 deletions
25
ree_lib/lib/ree_lib/packages/ree_mapper/package/ree_mapper/errors/error_with_location.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
class ReeMapper::ErrorWithLocation < ReeMapper::Error | ||
attr_reader :location | ||
|
||
def initialize(message, location = nil) | ||
if message.is_a?(String) && location && ENV["RUBY_ENV"] == "test" | ||
message = "#{message}, located at #{location}" | ||
end | ||
|
||
super(message) | ||
@location = location | ||
end | ||
|
||
def full_message(...) | ||
msg = super | ||
return msg if location.nil? | ||
|
||
idx = msg.index(/\).*\n/) | ||
return msg if idx.nil? | ||
return msg if ENV["RUBY_ENV"] == "test" | ||
|
||
msg.insert(idx + 1, ", located at #{location}") | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
ree_lib/lib/ree_lib/packages/ree_mapper/package/ree_mapper/errors/type_error.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class ReeMapper::TypeError < ReeMapper::Error | ||
class ReeMapper::TypeError < ReeMapper::ErrorWithLocation | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.