"Sorry, an error has occurred" when trying to add a custom email to category


(Caue Rego) #1

When trying to set a Custom incoming email address to a category, I’ve got this error:

Sorry, an error has occurred.

I could then easily see on the log why that happens. I suppose we can only use one incoming email per category:

ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_categories_on_email_in"
DETAIL: Key (email_in)=(help@cregox.com) already exists.
: UPDATE “categories” SET “email_in” = $1, “updated_at” = $2 WHERE “categories”.“id” = 15)

I just thought I would report this as I believe the first error message could probably be easily improved. Specially nice if it could say which category already had the email! :blush:


"Job exception: can_create? failed" - Unrecognized error type when processing incoming email
(Jeff Atwood) #2

Yes let’s improve this error message – can you add to your list @techapj?


(Arpit Jalan) #3

Done! :smile:

https://github.com/discourse/discourse/pull/3383


(Jeff Atwood) #4