Skip to content

Commit

Permalink
update errors for encode/decode exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
raghuramg committed Dec 30, 2024
1 parent d24195a commit 1b80d76
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/event_source/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Error < StandardError
ServerConfigurationNotFound = Class.new(Error)
ServerConfigurationInvalid = Class.new(Error)
MessageBuildError = Class.new(Error)
PayloadCompressionError = Class.new(Error)
PayloadDecompressionError = Class.new(Error)
PayloadEncodeError = Class.new(Error)
PayloadDecodeError = Class.new(Error)
end
end
2 changes: 1 addition & 1 deletion lib/event_source/protocols/amqp/bunny_queue_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def decode_payload(payload)
output.value!
else
logger.error "Failed to decompress message \n due to: #{output.failure}"
raise EventSource::Error::PayloadDecompressionError, output.failure
raise EventSource::Error::PayloadDecodeError, output.failure
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/event_source/publish_operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def encode_payload(payload)
output.value!
else
logger.error "Failed to decompress message \n due to: #{output.failure}"
raise EventSource::Error::PayloadCompressionError, output.failure
raise EventSource::Error::PayloadEncodeError, output.failure
end
end
end
Expand Down

0 comments on commit 1b80d76

Please sign in to comment.