Closed micahalcorn closed 5 years ago
I think it's good to throw them from origin.js, but when it's not an error we need to show the user, something at the dapp layer needs to catch and ignore these errors.
@DanielVF but if I call getNotifications
and someone has injected an invalid listing that matches my filters, I will never get them, right?
I'll fix this shortly
As mentioned here and here, it may not be appropriate to throw errors when invalid offers are retrieved. If a method is called, which internally retrieves all offers matching a certain criteria, these errors will surface and prevent the returning of the expected value. This is a bad developer experience because the caller didn't explicitly ask for the invalid thing and the request itself was valid. This can also lead to side effects that are bad for end users.
I don't know if it's best to just silently swallow the invalid offers, log errors, or what.
cc @franckc @DanielVF @tyleryasaka