admin管理员组文章数量:1391868
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.
1 Answer
Reset to default 0Personally 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.
本文标签: wp errorTo stylize WPError messages or not
版权声明:本文标题:wp error - To stylize WP_Error messages or not? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744770422a2624304.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论