improve message of error response

This commit is contained in:
wataru 2023-01-16 08:09:53 +09:00
parent ff6a5f3963
commit 41523546e4
6 changed files with 56 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@dannadori/voice-changer-client-js": "^1.0.14",
"@dannadori/voice-changer-client-js": "^1.0.18",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
@ -46,6 +46,41 @@
"webpack-dev-server": "^4.11.1"
}
},
"../lib": {
"name": "@dannadori/voice-changer-client-js",
"version": "1.0.15",
"extraneous": true,
"license": "ISC",
"dependencies": {
"@types/readable-stream": "^2.3.15",
"amazon-chime-sdk-js": "^3.10.0",
"microphone-stream": "^6.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"readable-stream": "^4.3.0",
"socket.io-client": "^4.5.4"
},
"devDependencies": {
"@types/audioworklet": "^0.0.36",
"@types/node": "^18.11.18",
"@types/react": "18.0.26",
"@types/react-dom": "18.0.10",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.0",
"eslint-webpack-plugin": "^3.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.3",
"raw-loader": "^4.0.2",
"rimraf": "^4.0.7",
"ts-loader": "^9.4.2",
"typescript": "^4.9.4",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
}
},
"node_modules/@ampproject/remapping": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
@ -2837,9 +2872,9 @@
}
},
"node_modules/@dannadori/voice-changer-client-js": {
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.14.tgz",
"integrity": "sha512-JrXSJDn7l1lH7FUiQYyeXn8HbRLN6I34sKOGAT45yTzu4p/rZd9e3d3VZBHbDJ4g/0uTtJYfH25Dc22cgBsiBg==",
"version": "1.0.18",
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.18.tgz",
"integrity": "sha512-Zw7x6lyQVKrlpyK1mQ5Fj1jCiEQwaGmm7DU4nv59RGuFfjkY7CHTV3TAKtDKaHFhIEP/o7c4h1ck8Bp4XTHd1w==",
"dependencies": {
"@types/readable-stream": "^2.3.15",
"amazon-chime-sdk-js": "^3.10.0",
@ -12406,9 +12441,9 @@
}
},
"@dannadori/voice-changer-client-js": {
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.14.tgz",
"integrity": "sha512-JrXSJDn7l1lH7FUiQYyeXn8HbRLN6I34sKOGAT45yTzu4p/rZd9e3d3VZBHbDJ4g/0uTtJYfH25Dc22cgBsiBg==",
"version": "1.0.18",
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.18.tgz",
"integrity": "sha512-Zw7x6lyQVKrlpyK1mQ5Fj1jCiEQwaGmm7DU4nv59RGuFfjkY7CHTV3TAKtDKaHFhIEP/o7c4h1ck8Bp4XTHd1w==",
"requires": {
"@types/readable-stream": "^2.3.15",
"amazon-chime-sdk-js": "^3.10.0",

View File

@ -48,7 +48,7 @@
"webpack-dev-server": "^4.11.1"
},
"dependencies": {
"@dannadori/voice-changer-client-js": "^1.0.14",
"@dannadori/voice-changer-client-js": "^1.0.19",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}

View File

@ -1,12 +1,12 @@
{
"name": "@dannadori/voice-changer-client-js",
"version": "1.0.14",
"version": "1.0.19",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@dannadori/voice-changer-client-js",
"version": "1.0.14",
"version": "1.0.19",
"license": "ISC",
"dependencies": {
"@types/readable-stream": "^2.3.15",

View File

@ -1,6 +1,6 @@
{
"name": "@dannadori/voice-changer-client-js",
"version": "1.0.14",
"version": "1.0.19",
"description": "",
"main": "dist/index.js",
"directories": {

View File

@ -48,6 +48,10 @@ export const useClient = (props: UseClientProps): ClientState => {
const [volume, setVolume] = useState<number>(0)
// (1-4) エラーステータス
const errorCountRef = useRef<number>(0)
// (2-1) 初期化処理
useEffect(() => {
const initialized = async () => {
@ -64,6 +68,11 @@ export const useClient = (props: UseClientProps): ClientState => {
notifyException: (mes: string) => {
if (mes.length > 0) {
console.log(`error:${mes}`)
errorCountRef.current += 1
if (errorCountRef.current > 100) {
alert("エラーが頻発しています。対象としているフレームワークのモデルがロードされているか確認してください。")
errorCountRef.current = 0
}
}
}
}, {