Added some exception handling for when failing to parse mime type.