Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to capture Netty errors #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TecdocCatalogBackend
Copy link

We had the need to be able to capture netty errors and handle then, as this lib is opensource, we wanted to keep custom implementation details outside, so the lib would only allow to register a different exception handler, which by default if not specified will work the same way.

If it's relevant the main use case, was to be able to capture Connection Reset By Peer errors, and log then at a different level, other than error

@tpunder
Copy link
Owner

tpunder commented Apr 24, 2024

Hi Kevin,

Your branch doesn't compile on Scala 2.11:

sbt:fm-http> + compile
[info] Setting Scala version to 2.11.12 on 1 projects.
[info] Reapplying settings...
[info] set current project to fm-http (in build file:/private/var/tmp/fm-http/)
[info] compiling 69 Scala sources to /private/var/tmp/fm-http/target/scala-2.11/classes ...
[error] /private/var/tmp/fm-http/src/main/scala/fm/http/server/HttpServer.scala:66:1: identifier expected but ')' found.
[error] ) extends Logging {
[error] ^
[error] /private/var/tmp/fm-http/src/main/scala/fm/http/server/HttpServer.scala:199:2: ':' expected but eof found.
[error] }
[error]  ^
[error] /private/var/tmp/fm-http/src/main/scala/fm/http/server/HttpServerApp.scala:139:5: illegal start of simple expression
[error]     )
[error]     ^
[error] /private/var/tmp/fm-http/src/main/scala/fm/http/server/HttpServerApp.scala:192:3: ')' expected but '}' found.
[error]   }
[error]   ^
[error] /private/var/tmp/fm-http/src/main/scala/fm/http/server/HttpServerOptions.scala:114:1: identifier expected but ')' found.
[error] ) {
[error] ^
[error] /private/var/tmp/fm-http/src/main/scala/fm/http/server/HttpServerOptions.scala:116:3: ':' expected but eof found.
[error] }
[error]  ^
[error] /private/var/tmp/fm-http/src/main/scala/fm/http/server/NettyHttpServerPipelineHandler.scala:66:1: identifier expected but ')' found.
[error] ) extends SimpleChannelInboundHandler[HttpObject] with Logging {
[error] ^
[error] /private/var/tmp/fm-http/src/main/scala/fm/http/server/NettyHttpServerPipelineHandler.scala:542:2: ':' expected but eof found.
[error] }
[error]  ^
[error] 8 errors found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 2 s, completed Apr 24, 2024, 7:56:28 AM

@tpunder
Copy link
Owner

tpunder commented Apr 24, 2024

Also, I usually test/build/publish with Java 11 for better compatibility. That probably makes the Policy deprecation warning/error go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants