If an IllegalArgumentException is thrown during TraceFilter.createSpan the filter tries to set an error code. Unfortunately is does this after calling the filter so the response is likely to be already committed.
The root cause of the exception is lost and it's not possible to tell what caused the original failure. I think it would be better to just remove this code and instead let the exception propagate.