RAILS 6从失败的单元结果获取错误消息
是否有可能收到作为失败单元结果传递的错误消息?据我所见,为提供了
方法成功> ,但是否也可以从失败中获取消息?
response[0]
=> Failure("12345 - Product code is not valid")
像:
response[0].message
=> "12345 - Product code is not valid"
Is it possible to get error message which was passed as a Failure monad result? as far as I can see the value!
method is provided for Success
but is it possible to get message from Failure as well?
response[0]
=> Failure("12345 - Product code is not valid")
to be something like:
response[0].message
=> "12345 - Product code is not valid"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要访问失败消息
失败monad
提供失败方法。To access the Failure message
Failure monad
provides failure method.