Skip to content

Commit

Permalink
error handling (#144)
Browse files Browse the repository at this point in the history
* log error and dont emit

* save
  • Loading branch information
rileylnapier authored Jan 10, 2022
1 parent 411065d commit 7d2633c
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["packages/*"],
"version": "1.3.2",
"version": "1.3.3",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
Expand Down
10 changes: 5 additions & 5 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trycourier/components",
"version": "1.3.2",
"version": "1.3.3",
"private": true,
"description": "Beautiful, easy React toast notifications",
"author": "Courier <[email protected]>",
Expand All @@ -17,10 +17,10 @@
"license": "MIT",
"dependencies": {
"@trycourier/courier": "^1.3.0",
"@trycourier/react-inbox": "^1.3.2",
"@trycourier/react-preferences": "^1.3.2",
"@trycourier/react-provider": "^1.3.2",
"@trycourier/react-toast": "^1.3.2",
"@trycourier/react-inbox": "^1.3.3",
"@trycourier/react-preferences": "^1.3.3",
"@trycourier/react-provider": "^1.3.3",
"@trycourier/react-toast": "^1.3.3",
"babel-loader": "^8.0.6",
"babel-preset-preact": "^2.0.0",
"camel-case": "^4.1.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/react-inbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trycourier/react-inbox",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "dist/index.js",
"types": "typings/index.d.ts",
Expand All @@ -22,8 +22,8 @@
"dependencies": {
"@apollo/client": "^3.3.11",
"@tippyjs/react": "^4.2.3",
"@trycourier/react-preferences": "^1.3.2",
"@trycourier/react-provider": "^1.3.2",
"@trycourier/react-preferences": "^1.3.3",
"@trycourier/react-provider": "^1.3.3",
"classnames": "^2.2.6",
"date-fns": "^2.19.0",
"deep-extend": "^0.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-preferences/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trycourier/react-preferences",
"version": "1.3.2",
"version": "1.3.3",
"main": "dist/index.js",
"types": "typings/index.d.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trycourier/react-provider",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "dist/index.js",
"types": "typings/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/react-provider/src/transports/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface IActionBlock {
}
export interface ICourierMessage {
event?: string;
error?: string;
body?: string | React.ReactElement;
blocks?: Array<ITextBlock | IActionBlock>;
icon?: string | false;
Expand Down
5 changes: 5 additions & 0 deletions packages/react-provider/src/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export class WS {
return;
}

if (message.error) {
console.error(message.error);
return;
}

for (const sub of this.subscriptions) {
if (sub.event !== "*" && sub.event !== message?.event) {
continue;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-toast/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trycourier/react-toast",
"version": "1.3.2",
"version": "1.3.3",
"description": "Beautiful, easy React toast notifications",
"main": "dist/index.js",
"types": "typings/index.d.ts",
Expand All @@ -25,7 +25,7 @@
"concat-md": "^0.3.5"
},
"dependencies": {
"@trycourier/react-provider": "^1.3.2",
"@trycourier/react-provider": "^1.3.3",
"deep-extend": "^0.6.0",
"react-toastify": "^6.2.0",
"rimraf": "^3.0.2",
Expand Down
12 changes: 6 additions & 6 deletions packages/storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trycourier/storybook",
"version": "1.3.2",
"version": "1.3.3",
"private": true,
"description": "Beautiful, easy React toast notifications",
"author": "Courier <[email protected]>",
Expand All @@ -22,11 +22,11 @@
"@storybook/addon-links": "^6.1.14",
"@storybook/addon-viewport": "^6.4.9",
"@storybook/react": "^6.1.14",
"@trycourier/components": "^1.3.2",
"@trycourier/react-inbox": "^1.3.2",
"@trycourier/react-preferences": "^1.3.2",
"@trycourier/react-provider": "^1.3.2",
"@trycourier/react-toast": "^1.3.2",
"@trycourier/components": "^1.3.3",
"@trycourier/react-inbox": "^1.3.3",
"@trycourier/react-preferences": "^1.3.3",
"@trycourier/react-provider": "^1.3.3",
"@trycourier/react-toast": "^1.3.3",
"react-markdown": "^6.0.1",
"storybook": "^6.1.21",
"styled-components": "^5.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@trycourier/types",
"private": true,
"version": "1.3.2",
"version": "1.3.3",
"main": "index.d.ts",
"types": "index.d.ts",
"scripts": {}
Expand Down

0 comments on commit 7d2633c

Please sign in to comment.