Skip to content

[Fix] - add logs#9

Open
gabrielMatosBoubee wants to merge 1 commit intomainfrom
chore/add-logs
Open

[Fix] - add logs#9
gabrielMatosBoubee wants to merge 1 commit intomainfrom
chore/add-logs

Conversation

@gabrielMatosBoubee
Copy link
Contributor

No description provided.

metadataString,
metadataUint8Array,
});
return { metadata: "", binaryData };
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say metadata can't be a string but rather an object, however there's no way to parse data without metadata information, so my preference is to rethrow the error instead of creating inconsistent behaviours returning empty strings and arbitrary data.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return { metadata: "", binaryData };
throw error;

@mcandeia
Copy link
Contributor

Also, if there are any unhandled exceptions you can set a global unhandled rejection handler preventing the application to panic when such case happened.

here: https://github.com/deco-sites/simpletunnel/blob/main/main.ts

globalThis.onunhandledrejection = function() {
    console.error("Unhandled rejection");
};

rectifying that this should be placed on simpletunnel rather than here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants