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

docs(core): update examples to demonstrate z.errors.Error #198

Merged
merged 1 commit into from
Apr 13, 2020
Merged

Conversation

FokkeZB
Copy link
Contributor

@FokkeZB FokkeZB commented Apr 10, 2020

Updates example apps and snippets to demonstrate (and with that encourage) the use of z.errors.Error over Error.

JIRA: SXP-1624 Replace use of Error by z.errors.Error in examples and docs

@FokkeZB FokkeZB added documentation Improvements or additions to documentation core example-apps labels Apr 10, 2020
@FokkeZB FokkeZB requested review from eliangcs and xavdid April 10, 2020 13:16
@FokkeZB FokkeZB self-assigned this Apr 10, 2020
Copy link
Contributor Author

@FokkeZB FokkeZB left a comment

Choose a reason for hiding this comment

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

self-review

throw new Error('The username and/or password you supplied is incorrect');
throw new z.errors.Error(
'The username and/or password you supplied is incorrect',
'AuthenticationError',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The second argument can be any code and as long as we're the only ones able to create troubleshooting docs, this isn't of much direct use to the developer.

However, the idea is/was that we'll grow a set of standard codes that we have generic troubleshooting docs on and ultimately, we'd to list the most common error codes we see for an app in its dashboard and maybe even allow partners to write their own troubleshooting docs for them.

@@ -8,7 +8,7 @@ const contentDisposition = require('content-disposition')
// on the OneDrive API. We intentionally don't set it up as an `afterResposne`
// handler because not *all* calls need it (i.e. the auth test and file create),
// so we break it out and share the code this way instead.
const parseResponse = (type, response) => {
const parseResponse = (z, type, response) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Notice that the signature of this function has changed. All usage has been updated.

packages/cli/README.md Show resolved Hide resolved
Copy link
Member

@eliangcs eliangcs left a comment

Choose a reason for hiding this comment

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

Looks good! Feel free to merge once you move the doc changes on README.md to README-source.md.

packages/cli/README.md Show resolved Hide resolved
@FokkeZB FokkeZB merged commit a9df76c into master Apr 13, 2020
@FokkeZB FokkeZB deleted the SXP-1624 branch April 13, 2020 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core documentation Improvements or additions to documentation example-apps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants