[API] Inconsistent error message when deleting a tag


When trying to delete a non-existent topic with the API, I get this (somewhat) understandable error:

content={"errors":["You are not permitted to view the requested resource."], 

When trying to delete a non-existent tag, I get this:

content=NoMethodError in TagsController#destroy - 
    undefined method `destroy' for nil:NilClass

(Sam Saffron) #2

API can be better here, #pr-welcome for that.

(Eleanor Demis) #3

I’ll take a stab at fixing this.

(Eleanor Demis) #4

Link to my fix: FIX: response error when deleting non-existent tags by ecdemis123 · Pull Request #5213 · discourse/discourse · GitHub

(Eric Berry) #5

^ PR has been merged on Oct 2 :allthethings:

(Sam Saffron) closed #6