Skip to content

Commit

Permalink
web error handler (#1148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksyeo1010 authored Oct 26, 2023
1 parent e650373 commit 8c86c5c
Show file tree
Hide file tree
Showing 19 changed files with 800 additions and 743 deletions.
2 changes: 1 addition & 1 deletion binding/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@angular-eslint/template-parser": "~13.5.0",
"@angular/cli": "~13.3.9",
"@angular/compiler-cli": "~13.3.0",
"@picovoice/porcupine-web": "=3.0.0",
"@picovoice/porcupine-web": "=3.0.1",
"@picovoice/web-voice-processor": "~4.0.8",
"@types/node": "^18.11.9",
"@typescript-eslint/eslint-plugin": "^5.27.1",
Expand Down
4 changes: 2 additions & 2 deletions binding/angular/projects/porcupine-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@picovoice/porcupine-angular",
"description": "Angular service for Porcupine Web SDK",
"version": "3.0.0",
"version": "3.0.1",
"peerDependencies": {
"@angular/common": ">=13.0.0",
"@angular/core": ">=13.0.0",
Expand All @@ -20,7 +20,7 @@
"author": "Picovoice Inc",
"license": "Apache-2.0",
"dependencies": {
"@picovoice/porcupine-web": "=3.0.0",
"@picovoice/porcupine-web": "=3.0.1",
"tslib": "^2.3.0"
}
}
8 changes: 4 additions & 4 deletions binding/angular/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1783,10 +1783,10 @@
node-addon-api "^3.2.1"
node-gyp-build "^4.3.0"

"@picovoice/porcupine-web@=3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@picovoice/porcupine-web/-/porcupine-web-3.0.0.tgz#e97e5e90b37af2b4938637efcaaf3cedc9fad6a3"
integrity sha512-zwhdh2YHy867wwp6G9YQU0q94VCveOQAAjeeDNFK/poJVtCaVc56kFH7wW0odkJ6s49ob8rQwOBdg7iPpZD0Fw==
"@picovoice/porcupine-web@=3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@picovoice/porcupine-web/-/porcupine-web-3.0.1.tgz#2c37779d4670cb60c4f1c59fe2f719e8be0668ae"
integrity sha512-Fv0besxrygjfk2H6TOPfFAD5fFebSy/kIDtjrNFGJdYlgGz9/IXgoYp+baFwIOAjMNOyQwebwy13fjb7Ba3EzQ==
dependencies:
"@picovoice/web-utils" "=1.3.1"

Expand Down
4 changes: 2 additions & 2 deletions binding/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/porcupine-react",
"version": "3.0.0",
"version": "3.0.1",
"description": "React component for Porcupine Web SDK",
"entry": "src/index.ts",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -36,7 +36,7 @@
"test": "cypress run --component"
},
"dependencies": {
"@picovoice/porcupine-web": "=3.0.0"
"@picovoice/porcupine-web": "=3.0.1"
},
"devDependencies": {
"@babel/core": "^7.21.3",
Expand Down
8 changes: 4 additions & 4 deletions binding/react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1110,10 +1110,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@picovoice/porcupine-web@=3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@picovoice/porcupine-web/-/porcupine-web-3.0.0.tgz#e97e5e90b37af2b4938637efcaaf3cedc9fad6a3"
integrity sha512-zwhdh2YHy867wwp6G9YQU0q94VCveOQAAjeeDNFK/poJVtCaVc56kFH7wW0odkJ6s49ob8rQwOBdg7iPpZD0Fw==
"@picovoice/porcupine-web@=3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@picovoice/porcupine-web/-/porcupine-web-3.0.1.tgz#2c37779d4670cb60c4f1c59fe2f719e8be0668ae"
integrity sha512-Fv0besxrygjfk2H6TOPfFAD5fFebSy/kIDtjrNFGJdYlgGz9/IXgoYp+baFwIOAjMNOyQwebwy13fjb7Ba3EzQ==
dependencies:
"@picovoice/web-utils" "=1.3.1"

Expand Down
4 changes: 2 additions & 2 deletions binding/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/porcupine-vue",
"version": "3.0.0",
"version": "3.0.1",
"description": "Vue binding for Porcupine Web SDK",
"author": "Picovoice Inc",
"entry": "src/index.ts",
Expand All @@ -20,7 +20,7 @@
"test": "cypress run --component"
},
"dependencies": {
"@picovoice/porcupine-web": "=3.0.0"
"@picovoice/porcupine-web": "=3.0.1"
},
"devDependencies": {
"@babel/core": "^7.21.3",
Expand Down
8 changes: 4 additions & 4 deletions binding/vue/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1266,10 +1266,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@picovoice/porcupine-web@=3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@picovoice/porcupine-web/-/porcupine-web-3.0.0.tgz#e97e5e90b37af2b4938637efcaaf3cedc9fad6a3"
integrity sha512-zwhdh2YHy867wwp6G9YQU0q94VCveOQAAjeeDNFK/poJVtCaVc56kFH7wW0odkJ6s49ob8rQwOBdg7iPpZD0Fw==
"@picovoice/porcupine-web@=3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@picovoice/porcupine-web/-/porcupine-web-3.0.1.tgz#2c37779d4670cb60c4f1c59fe2f719e8be0668ae"
integrity sha512-Fv0besxrygjfk2H6TOPfFAD5fFebSy/kIDtjrNFGJdYlgGz9/IXgoYp+baFwIOAjMNOyQwebwy13fjb7Ba3EzQ==
dependencies:
"@picovoice/web-utils" "=1.3.1"

Expand Down
2 changes: 1 addition & 1 deletion binding/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Porcupine wake word engine for web browsers (via WebAssembly)",
"author": "Picovoice Inc",
"license": "Apache-2.0",
"version": "3.0.0",
"version": "3.0.1",
"keywords": [
"porcupine",
"web",
Expand Down
20 changes: 14 additions & 6 deletions binding/web/src/porcupine_worker_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,20 @@ self.onmessage = async function(
sampleRate: porcupine.sampleRate,
});
} catch (e: any) {
self.postMessage({
command: 'error',
status: PvStatus.RUNTIME_ERROR,
shortMessage: e.shortMessage,
messageStack: e.messageStack
});
if (e instanceof PorcupineError) {
self.postMessage({
command: 'error',
status: e.status,
shortMessage: e.shortMessage,
messageStack: e.messageStack
});
} else {
self.postMessage({
command: 'error',
status: PvStatus.RUNTIME_ERROR,
shortMessage: e.message
});
}
}
break;
case 'process':
Expand Down
2 changes: 1 addition & 1 deletion demo/angular-stt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"@picovoice/porcupine-angular": "~3.0.0",
"@picovoice/porcupine-angular": "~3.0.1",
"@picovoice/web-voice-processor": "~4.0.8",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
Expand Down
Loading

0 comments on commit 8c86c5c

Please sign in to comment.