[wp-trac] [WordPress Trac] #50546: Add better error notices when deleting things fail

WordPress Trac noreply at wordpress.org
Fri Jul 3 09:50:02 UTC 2020


#50546: Add better error notices when deleting things fail
----------------------------+-------------------------------------
 Reporter:  dingo_d         |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:
 Severity:  normal          |   Keywords:  needs-patch 2nd-opinion
  Focuses:                  |
----------------------------+-------------------------------------
 I've stumbled upon this when working with foreign key restraints and post
 deletion. Working on a project I've added some data to the custom DB table
 row that has a foreign key association with custom post type post.

 So, when I try to delete the post it will fail, as it should 🎉.

 But the error I got was: `Error in deleting`.

 Hmmm, ok. Not a big deal. WordPress is pretty flexible in most cases, so
 there's bound to be a filter for that.

 When searching for it, upon checking the above string I've found 5 matches
 in 3 files. So if some error happens when deleting a post, you'll get that
 message in `wp_die`. If it happens on attachment delete, the same message.

 How are you supposed to know where that error came from, just from the
 message? You need to check the error log, etc. Which is ok when you're a
 developer, but what if you're not? A user could get this message on the
 screen from some plugin and then they'll open up a support question with
 this message.

 Not really helping the debugging process.

 I'm not saying the entire stack trace should be visible (that is advanced
 debugging), but even just adding `Error in deleting a post`, or `Error in
 deleting an attachment` would be an improvement IMO.

 Having some extra details would be even better, but small steps first.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50546>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list