diff --git a/app/file.go b/app/file.go index bda26fd9b5..423017260f 100644 --- a/app/file.go +++ b/app/file.go @@ -648,8 +648,8 @@ func (t *uploadFileTask) runPlugins() *model.AppError { replacementInfo, rejectionReason := hooks.FileWillBeUploaded(pluginContext, t.fileinfo, t.newReader(), buf) if rejectionReason != "" { - rejectionError = t.newAppError("api.file.upload_file.read_request.app_error", - rejectionReason, http.StatusBadRequest) + rejectionError = t.newAppError("api.file.upload_file.rejected_by_plugin.app_error", + rejectionReason, http.StatusForbidden, "Reason", rejectionReason) return false } if replacementInfo != nil { diff --git a/i18n/en.json b/i18n/en.json index 04f468be45..8b4046c0f5 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1252,6 +1252,10 @@ "id": "api.file.upload_file.too_large_detailed.app_error", "translation": "Unable to upload file {{.Filename}}. {{.Length}} bytes exceeds the maximum allowed {{.Limit}} bytes." }, + { + "id": "api.file.upload_file.rejected_by_plugin.app_error", + "translation": "Unable to upload file {{.Filename}}. Rejected by plugin: {{.Reason}}" + }, { "id": "api.file.write_file.s3.app_error", "translation": "Encountered an error writing to S3"