wp error - To stylize WP_Error messages or not?

I hate, despise forcing markupstylization on anyone that extends my system because I'm making assumptions about ho

I hate, despise forcing markup/stylization on anyone that extends my system because I'm making assumptions about how my code is going to be used and force people to play around my decision-making.

Thing is, I'm now faced with an issue. I have a really long WP_Error message, it's like 100 salamis all put together long.

I kinda wanna insert a \r\n between these messages to make it readable.

Is there no middle-ground? I'm also offering these messages separated in the error_data but, of course, it'd be nicer to have it readable from the get-go.

I hate, despise forcing markup/stylization on anyone that extends my system because I'm making assumptions about how my code is going to be used and force people to play around my decision-making.

Thing is, I'm now faced with an issue. I have a really long WP_Error message, it's like 100 salamis all put together long.

I kinda wanna insert a \r\n between these messages to make it readable.

Is there no middle-ground? I'm also offering these messages separated in the error_data but, of course, it'd be nicer to have it readable from the get-go.

Share Improve this question asked Feb 7, 2020 at 5:43 Daniel MDaniel M 531 silver badge8 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Personally I prefer to put all errors in a debug.log file using error_log and it would be readable enough as it includes break lines automatically.

I think not all the errors should be visible for clients. In case that I need to show an error to the user, I check the error type and I show a short message with a custom code like Sorry, Post ID is missing [error 12] and the I know Error 12 could happen in certain cases.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744770423a4592724.html

相关推荐

  • wp error - To stylize WP_Error messages or not?

    I hate, despise forcing markupstylization on anyone that extends my system because I'm making assumptions about ho

    16小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信