Skip to content

Commit a056c3a

Browse files
authored
Editorial: rename "respond with an error" (#331)
The proposal defines "error" as an internal type for describing one kind of result of fallible algorithms, and it defines "ErrorResponse" as a type of message which may be sent to clients. The algorithm used to transmit error responses to clients is named "respond with an error" even though it does not use the "error" type. Rename "respond with an error" to "send an error response" to more accurately describe the types involved.
1 parent 604cadb commit a056c3a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

index.bs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,8 @@ typically be "<code>localhost</code>".
731731
To <dfn>handle an incoming message</dfn> given a [=WebSocket connection=]
732732
|connection|, type |type| and data |data|:
733733

734-
1. If |type| is not [=%x1 denotes a text frame|text=], [=respond with an
735-
error=] given |connection|, null, and [=invalid argument=], and finally
734+
1. If |type| is not [=%x1 denotes a text frame|text=], [=send an error
735+
response=] given |connection|, null, and [=invalid argument=], and finally
736736
return.
737737

738738
1. [=Assert=]: |data| is a [=scalar value string=], because the
@@ -749,8 +749,8 @@ To <dfn>handle an incoming message</dfn> given a [=WebSocket connection=]
749749
null. Otherwise, return.
750750

751751
1. Let |parsed| be the result of [=parse JSON into Infra values|parsing JSON
752-
into Infra values=] given |data|. If this throws an exception, then [=respond
753-
with an error=] given |connection|, null, and [=invalid argument=], and
752+
into Infra values=] given |data|. If this throws an exception, then [=send
753+
an error response=] given |connection|, null, and [=invalid argument=], and
754754
finally return.
755755

756756
1. Match |parsed| against the [=remote end definition=]. If this results in a
@@ -768,7 +768,7 @@ To <dfn>handle an incoming message</dfn> given a [=WebSocket connection=]
768768
1. Let |command| be the command with [=command name=] |method|.
769769

770770
1. If |session| is null and |command| is not a [=static command=], then
771-
[=respond with an error=] given |connection|, |command id|, and [=invalid
771+
[=send an error response=] given |connection|, |command id|, and [=invalid
772772
session id=], and return.
773773

774774
1. Run the following steps in parallel:
@@ -777,7 +777,7 @@ To <dfn>handle an incoming message</dfn> given a [=WebSocket connection=]
777777
|command| given |session| and [=command parameters=]
778778
|matched|["<code>params</code>"]
779779

780-
1. If |result| is an [=error=], then [=respond with an error=] given
780+
1. If |result| is an [=error=], then [=send an error response=] given
781781
|connection|, |command id|, and |result|'s [=error code=], and finally
782782
return.
783783

@@ -816,7 +816,7 @@ To <dfn>handle an incoming message</dfn> given a [=WebSocket connection=]
816816
string, but |parsed|["<code>method</code>"] is not in the [=set of all
817817
command names=], set |error code| to [=unknown command=].
818818

819-
1. [=Respond with an error=] given |connection|, |command id|, and
819+
1. [=Send an error response=] given |connection|, |command id|, and
820820
|error code|.
821821

822822
</div>
@@ -858,7 +858,7 @@ To <dfn>get related browsing contexts</dfn> given an [=script/settings object=]
858858
</div>
859859

860860
<div algorithm>
861-
To <dfn>respond with an error</dfn> given a [=WebSocket connection=]
861+
To <dfn>send an error response</dfn> given a [=WebSocket connection=]
862862
|connection|, |command id|, and |error code|:
863863

864864
1. Let |error data| be a new map matching the <code>ErrorResponse</code>

0 commit comments

Comments
 (0)