[API] Inconsistent error message when deleting a tag


#1

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

status=403
content={"errors":["You are not permitted to view the requested resource."], 
    "error_type":"invalid_access"}

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

status=500 
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) #6