Giveth / impact-graph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve Error Logging for adding duplicate token

divine-comedian opened this issue · comments

When trying to add a token to the list when the same token has already been added we should show a more explicit error message to not confuse the administrator attempting to make the change

Screenshot from 2023-09-20 13-18-48

@RamRamez pls take a look at this.

@maryjaf to test and verify

when I set the fields just like a existing token, by tapping on "save " for the first time I got this error
"there was an error updating record, checkout console to see more information"

and by tpping again on "save" button, I got this error
duplicate key value violates unique constraint "IDX_4e29282c925a82d9e50480c2af"

@maryjaf Yes, I fixed it to return the DB error, and for a duplicate record DB returns something like "duplicate key value violates unique constraint"

when I set the fields just like a existing token, by tapping on "save " for the first time I got this error
"there was an error updating record, checkout console to see more information"

but by tapping on "save" for the first time, the previous error is shown
Is this accepted ?

I checked multiple times, you should be able to see this error for the first time
image

I've checked again and it was ok
This message is shown in duplicate token scenario :
duplicate key value violates unique constraint "IDX_4e29282c925a82d9e50480c2af"

Seems it's not merged on Prod, right? @RamRamez ?

Seems it's not merged on Prod, right? @RamRamez ?

No, it's on staging