Skip to content

Update ErrorHandling.rst #4099

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/ErrorHandling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ for developers to want to handle errors from different operations in
the same basic way, either by reporting the error to the user or
passing the error back to their own clients.

These errors will be the focus on this proposal.
These errors will be the focus of this proposal.

The final two classes of error are outside the scope of this proposal.
A **universal error** is theoretically recoverable, but by its nature
A **universal error** is theoretically recoverable, but by its nature,
Copy link
Contributor

Choose a reason for hiding this comment

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

Extraneous comma. If you wish to make the but parenthetical then move it there and reflow this sentence.

the language can't help the programmer anticipate where it will come
from. A **logic failure** arises from a programmer mistake and should
not be recoverable at all. In our system, these kinds of errors are
Expand Down Expand Up @@ -305,7 +305,7 @@ generalized ``do`` statement::
As with ``switch`` statements, Swift makes an effort to understand
whether catch clauses are exhaustive. If it can determine it is, then
the compiler considers the error to be handled. If not, the error
automatically propagates out out of scope, either to a lexically
automatically propagates out of scope, either to a lexically
enclosing ``catch`` clause or out of the containing function (which must
be marked ``throws``).

Expand All @@ -327,7 +327,7 @@ the type::
}

The ``enum`` provides a namespace of errors, a list of possible errors
within that namespace, and optional values to attach to each option.
within that namespace and optional values to attach to each option.
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep the oxford comma.


Note that this corresponds very cleanly to the ``NSError`` model of an
error domain, an error code, and optional user data. We expect to
Expand Down Expand Up @@ -534,7 +534,7 @@ For other sentinel cases, we can consider adding a new clang attribute
to indicate to the compiler what the sentinel is:

* There are several APIs returning ``NSInteger`` or ``NSUInteger``. At
least some of these return 0 on error, but that doesn't seem like a
least some of these return 0 on the error, but that doesn't seem like a
Copy link
Contributor

Choose a reason for hiding this comment

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

Extraneous. Please revert this.

reasonable general assumption.

* ``AVFoundation`` provides a couple methods returning
Expand Down Expand Up @@ -691,7 +691,7 @@ can throw, and so it must also be marked with ``try``::
}

This marking feels redundant. We want functions like
``autoreleasepool`` to feel like statements, but marks inside builtin
``autoreleasepool`` to feel like statements, but marks inside built-in
statements like ``if`` don't require the outer statement to be marked.
It would be better if the compiler didn't require the outer ``try``.

Expand Down