ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
137 stars 58 forks source link

[WebSub] HubStartedUpError is not an error #276

Open MaryamZi opened 4 years ago

MaryamZi commented 4 years ago

Description: @sanjiva pointed out $subject.

Seems like this was missed when migrating to the error type, from when error was a record.

MaryamZi commented 4 years ago

The error detail needs to be a subtype of

public type Detail record {|
    string message?;
    error cause?;
    (anydata|error)...;
|};

which means we can't add the started websub:Hub object in the error returned if the hub is already started.

So making this an error is not possible with the current structure.

The other option would be to just return an error, without including the websub:Hub object.

Thoughts, please? @sanjiva @chamil321