Skip to content

Non-descriptive pdf conversion HTTP error body #367

@tamaskamaras

Description

@tamaskamaras

Description

In the following scenarios of .pdf conversions, the /convert endpoint does not specify to the requesting client the cause of the conversion error, it simply just bounces back a 500.

  • password-protected file,
  • the pdf. contains only a single image.
    (The file is still valid as a .pdf, but the image content can not be converted to text),
  • the file is damaged. It cannot even be opened.

Current behavior

The /convert endpoint responds 500 Internal Server Error.

{
  response_body=> {
    status: 500,
    description: Conversion error: Heathen::ConversionFailed in step 'pdftotext'
  }
}

Expected behavior

The /convert endpoint responds 422 Unprocessable Content.

(and the response body might also contain information about the cause of the inability to convert. At least, for the above 3 cases where we exactly know what is wrong with the files.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions