Skip to content

Commit

Permalink
Added context details to assertion error message (#42)
Browse files Browse the repository at this point in the history
When HTTPServerHandler.channelRead finds itself in a unexpected combination of inbound data and channel state, this change makes the error message print the state and the part to make troubleshooting easier.
Changes only the printed error message, no changes to functionality.
  • Loading branch information
pobengtsson committed Jan 23, 2023
1 parent fc187b5 commit e2ea23e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/HummingbirdCore/Server/HTTPServerHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ final class HBHTTPServerHandler: ChannelDuplexHandler, RemovableChannelHandler {
break

default:
assertionFailure("Should not get here")
assertionFailure("Should not get here!\nPart: \(part)\nState: \(self.state)")
context.close(promise: nil)
}
}
Expand Down

0 comments on commit e2ea23e

Please sign in to comment.