Hey <@665800397805322270> are you the maintainer o...
# off-topic
j
Hey @soedirgo are you the maintainer of functions-js?
s
it's jointly maintained by some in the team. need anything?
j
Just wondering if you wanted some help maintaining it? I noticed a few things that could use some improvement (I made a comment on one of the PRs which I think needs improvement).
s
Hi guys, I think I am the one (Vejja) who made the PR you are talking about - PR #21
I can help with this PR if it needs improvement
I would imagine that the most controversial part about this PR is that it exports a new error class, which can possibly interfere with some future error-handling functionality
@soedirgo if this is the case, let me know. I can refactor the code to return a plain object rather than an instance of a class
j
@sraffray sorry no improvement needed, just that I think I could shoehorn a small change into it which I think still comes under the issue you raised
s
👍🏻
s
@jaitaiwan what's the small change you need? have replied to the PR btw
and sorry for the slow response - we're OK wrt maintenance, only that I forgot to watch the repo so this flew under the radar 😅
j
Just noted like the original issue that @sraffray posted that HTTP errors that come from the functions aren't treated as errors and so when the throw errors flag is unset, the errors are being populated in data instead of error
s
@jaitaiwan I don’t think so (unless I made a mistake) because I’m throwing all errors (including the HTTP errors) but then catching it again in the catch block which then looks at the flag - and then if the flag is unset returns { data:null, error }. So you should be covered ?
@soedirgo trying to make sure I understand your comment, but I’ll write on GitHub instead as it will be easier
j
Just looking at it again
Ok so @sraffray it doesn't capture if the function is designed to return say status code 422. That will ski;p the "isRelayError" check
s
are you sure? from the looks of it it should throw an error, get caught, and in
catch
get returned as the
error
in
{ data: null, error }
anw let's continue the discussion in the github issue? hard to keep track of conversations in 2 places at once
3 Views