mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 04:12:16 +01:00
fix(libreoffice): wrong HTTP status codes if invalid PDF formats
This commit is contained in:
@@ -64,7 +64,7 @@ func (engine *LibreOfficePdfEngine) Convert(ctx context.Context, logger *zap.Log
|
||||
return nil
|
||||
}
|
||||
|
||||
if errors.Is(err, api.ErrInvalidPdfFormat) {
|
||||
if errors.Is(err, api.ErrInvalidPdfFormats) {
|
||||
return fmt.Errorf("convert PDF to '%+v' with LibreOffice: %w", formats, gotenberg.ErrPdfFormatNotSupported)
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ func TestLibreOfficePdfEngine_Convert(t *testing.T) {
|
||||
scenario: "invalid PDF format",
|
||||
api: &api.ApiMock{
|
||||
PdfMock: func(ctx context.Context, logger *zap.Logger, inputPath, outputPath string, options api.Options) error {
|
||||
return api.ErrInvalidPdfFormat
|
||||
return api.ErrInvalidPdfFormats
|
||||
},
|
||||
},
|
||||
expectError: true,
|
||||
|
||||
Reference in New Issue
Block a user