From a9905ccf16b1642bc8468f27d317204a539ff5bf Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Fri, 20 Oct 2023 03:07:25 +0900 Subject: [PATCH] =?UTF-8?q?`=E2=80=A6NotFoundError`=E3=82=92`KeyError`?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../python/voicevox_core/_rust.pyi | 6 +++--- crates/voicevox_core_python_api/src/lib.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/voicevox_core_python_api/python/voicevox_core/_rust.pyi b/crates/voicevox_core_python_api/python/voicevox_core/_rust.pyi index 734bfb321..bd110f892 100644 --- a/crates/voicevox_core_python_api/python/voicevox_core/_rust.pyi +++ b/crates/voicevox_core_python_api/python/voicevox_core/_rust.pyi @@ -466,12 +466,12 @@ class GetSupportedDevicesError(Exception): ... -class StyleNotFoundError(Exception): +class StyleNotFoundError(KeyError): """スタイルIDに対するスタイルが見つからなかった。""" ... -class ModelNotFoundError(Exception): +class ModelNotFoundError(KeyError): """音声モデルIDに対する音声モデルが見つからなかった。""" ... @@ -501,7 +501,7 @@ class SaveUserDictError(Exception): ... -class WordNotFoundError(Exception): +class WordNotFoundError(KeyError): """ユーザー辞書に単語が見つからなかった。""" ... diff --git a/crates/voicevox_core_python_api/src/lib.rs b/crates/voicevox_core_python_api/src/lib.rs index b0a886d2c..1a492878e 100644 --- a/crates/voicevox_core_python_api/src/lib.rs +++ b/crates/voicevox_core_python_api/src/lib.rs @@ -6,7 +6,7 @@ use log::debug; use once_cell::sync::Lazy; use pyo3::{ create_exception, - exceptions::{PyException, PyValueError}, + exceptions::{PyException, PyKeyError, PyValueError}, pyclass, pyfunction, pymethods, pymodule, types::{IntoPyDict as _, PyBytes, PyDict, PyList, PyModule}, wrap_pyfunction, PyAny, PyObject, PyRef, PyResult, PyTypeInfo, Python, ToPyObject, @@ -62,14 +62,14 @@ exceptions! { StyleAlreadyLoadedError: PyException; InvalidModelDataError: PyException; GetSupportedDevicesError: PyException; - StyleNotFoundError: PyException; - ModelNotFoundError: PyException; + StyleNotFoundError: PyKeyError; + ModelNotFoundError: PyKeyError; InferenceFailedError: PyException; ExtractFullContextLabelError: PyException; ParseKanaError: PyValueError; LoadUserDictError: PyException; SaveUserDictError: PyException; - WordNotFoundError: PyException; + WordNotFoundError: PyKeyError; UseUserDictError: PyException; InvalidWordError: PyValueError; }