You're misreading the stack trace. MimeTypes.detect (or a method called from there) threw an exception, which was passed up the stack and terminated normal execution.