mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-18 21:22:15 +01:00
now returing bad request if no file to convert
This commit is contained in:
@@ -60,8 +60,12 @@ func convertHandler(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
c, err := converter.NewConverter(r)
|
||||
if err != nil {
|
||||
// TODO bad request if no file to convert
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
if _, ok := err.(*converter.NoFileToConvertError); ok {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
} else {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
logger.Error(err)
|
||||
|
||||
if c != nil {
|
||||
|
||||
Reference in New Issue
Block a user