Improved error signalling
This commit is contained in:
parent
7cfa084558
commit
409aa357db
|
@ -312,8 +312,8 @@ spawn named '@syndicate-lang/server/federation/ScopeFactory' {
|
|||
field this.linkSubs = Map();
|
||||
field this.linkMatches = Map();
|
||||
|
||||
const err = (detail) => {
|
||||
send P.Proposal(managementScope, P.ToPOA(linkid, W.Err(detail)));
|
||||
const err = (detail, context) => {
|
||||
send P.Proposal(managementScope, P.ToPOA(linkid, W.Err(detail, context || false)));
|
||||
turn.reset();
|
||||
currentFacet().stop();
|
||||
};
|
||||
|
@ -400,7 +400,7 @@ spawn named '@syndicate-lang/server/federation/ScopeFactory' {
|
|||
const captures = W.Add._captures(item);
|
||||
const matches = this.linkMatches.get(localid) || Set();
|
||||
if (matches.includes(captures)) {
|
||||
err(Symbol.for('duplicate-capture'));
|
||||
err(Symbol.for('duplicate-capture'), item);
|
||||
} else {
|
||||
this.linkMatches = this.linkMatches.set(localid, matches.add(captures));
|
||||
callWithSub(localid, linkid, (sub) => {
|
||||
|
@ -431,7 +431,7 @@ spawn named '@syndicate-lang/server/federation/ScopeFactory' {
|
|||
const captures = W.Del._captures(item);
|
||||
const matches = this.linkMatches.get(localid) || Set();
|
||||
if (!matches.includes(captures)) {
|
||||
err(Symbol.for('nonexistent-capture'));
|
||||
err(Symbol.for('nonexistent-capture'), item);
|
||||
} else {
|
||||
const newMatches = matches.remove(captures);
|
||||
this.linkMatches = (newMatches.isEmpty())
|
||||
|
|
|
@ -14,7 +14,7 @@ message type Add(endpointName, captures);
|
|||
message type Del(endpointName, captures);
|
||||
message type Msg(endpointName, captures);
|
||||
message type End(endpointName);
|
||||
message type Err(detail);
|
||||
message type Err(detail, context);
|
||||
|
||||
message type Ping();
|
||||
message type Pong();
|
||||
|
|
Loading…
Reference in New Issue