Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate axios errors 236 #246

Merged
merged 3 commits into from
Jan 8, 2021

Conversation

byronmurg
Copy link
Contributor

Overview

When calling an *AsStream method a client needs to handle errors
raised by couch. These errors can include retrieving an attachment
that doesn't exist or querying a deleted view.

Testing recommendations

The easiest way to test is to try retrieving an attachment that doesn't exist.

e.g.

alice.attachment.getAsStream('rabbit', 'doesntexist.png')
  .on('error', (e) => console.error(e))
  .pipe(/* handle stream */)

GitHub issue number

Fixes issue #236.

There are likely other issues that are affected by this, but 236 is the most recent.

Related Pull Requests

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

The material changes are covered by the tests however I am unable to get nock errors to emit with isAxiosError.

Byron Murgatroyd added 2 commits December 27, 2020 15:44
Fixes issue apache#236.

When calling an *AsStream method a client needs to handle errors
raised by couch. These errors can include retrieving an attachment
that doesn't exist or querying a deleted view.
Copy link
Contributor

@glynnbird glynnbird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. Thanks for taking the time to look at this. If you could fix up the ...AsStream documentation errors too that would be great. If you don't have time, let me know and I'll fix them separately.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
lib/nano.js Show resolved Hide resolved
The examples of several stream functions we not named *AsStream.
Copy link
Contributor

@glynnbird glynnbird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants