Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python APIとJava APIのエラーを詳細にする #640

Merged
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ resolver = "2"
anyhow = "1.0.65"
async_zip = { version = "0.0.11", features = ["full"] }
clap = { version = "4.0.10", features = ["derive"] }
derive_more = "0.99.17"
easy-ext = "1.0.1"
fs-err = { version = "2.9.0", features = ["tokio"] }
futures = "0.3.26"
Expand Down
2 changes: 1 addition & 1 deletion crates/voicevox_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async_zip.workspace = true
cfg-if = "1.0.0"
derive-getters.workspace = true
derive-new = "0.5.9"
derive_more = "0.99.17"
derive_more.workspace = true
duplicate = "1.0.0"
easy-ext.workspace = true
fs-err.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/voicevox_core_java_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ directml = ["voicevox_core/directml"]

[dependencies]
android_logger = "0.13.1"
anyhow.workspace = true
chrono = "0.4.26"
derive_more.workspace = true
jni = "0.21.1"
once_cell.workspace = true
serde_json.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
uuid.workspace = true
voicevox_core.workspace = true

[dev-dependencies]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** コンテキストラベル出力に失敗した。 */
public class ExtractFullContextLabelException extends IllegalArgumentException {
public ExtractFullContextLabelException(String message) {
super(message);
}

public ExtractFullContextLabelException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package jp.hiroshiba.voicevoxcore.exceptions;

import java.io.IOException;

/** サポートされているデバイス情報取得に失敗した。 */
public class GetSupportedDevicesException extends IOException {
public GetSupportedDevicesException(String message) {
super(message);
}

public GetSupportedDevicesException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** GPUモードがサポートされていない。 */
public class GpuSupportException extends RuntimeException {
public GpuSupportException(String message) {
super(message);
}

public GpuSupportException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package jp.hiroshiba.voicevoxcore.exceptions;

import java.io.IOException;

/** 推論に失敗した。 */
public class InferenceFailedException extends IOException {
public InferenceFailedException(String message) {
super(message);
}

public InferenceFailedException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package jp.hiroshiba.voicevoxcore.exceptions;

import java.io.IOException;

/** 無効なモデルデータ。 */
public class InvalidModelDataException extends IOException {
public InvalidModelDataException(String message) {
super(message);
}

public InvalidModelDataException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** ユーザー辞書の単語のバリデーションに失敗した。 */
public class InvalidWordException extends IllegalArgumentException {
public InvalidWordException(String message) {
super(message);
}

public InvalidWordException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package jp.hiroshiba.voicevoxcore.exceptions;

import java.io.IOException;

/** ユーザー辞書を読み込めなかった。 */
public class LoadUserDictException extends IOException {
public LoadUserDictException(String message) {
super(message);
}

public LoadUserDictException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** すでに読み込まれている音声モデルを読み込もうとした。 */
public class ModelAlreadyLoadedException extends IllegalStateException {
public ModelAlreadyLoadedException(String message) {
super(message);
}

public ModelAlreadyLoadedException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** 音声モデルIDに対する音声モデルが見つからなかった。 */
public class ModelNotFoundException extends IndexOutOfBoundsException {
public ModelNotFoundException(String message) {
super(message);
}

public ModelNotFoundException(String message, Throwable cause)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** open_jtalk辞書ファイルが読み込まれていない。 */
public class NotLoadedOpenjtalkDictException extends IllegalStateException {
public NotLoadedOpenjtalkDictException(String message) {
super(message);
}

public NotLoadedOpenjtalkDictException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package jp.hiroshiba.voicevoxcore.exceptions;

import java.io.IOException;

/** ZIPファイルを開くことに失敗した。 */
public class OpenZipFileException extends IOException {
public OpenZipFileException(String message) {
super(message);
}

public OpenZipFileException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** AquesTalk風記法のテキストの解析に失敗した。 */
public class ParseKanaException extends IllegalArgumentException {
public ParseKanaException(String message) {
super(message);
}

public ParseKanaException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package jp.hiroshiba.voicevoxcore.exceptions;

import java.io.IOException;

/** ZIP内のファイルが読めなかった。 */
public class ReadZipEntryException extends IOException {
public ReadZipEntryException(String message) {
super(message);
}

public ReadZipEntryException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package jp.hiroshiba.voicevoxcore.exceptions;

import java.io.IOException;

/** ユーザー辞書を書き込めなかった。 */
public class SaveUserDictException extends IOException {
public SaveUserDictException(String message) {
super(message);
}

public SaveUserDictException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** すでに読み込まれているスタイルを読み込もうとした。 */
public class StyleAlreadyLoadedException extends IllegalStateException {
public StyleAlreadyLoadedException(String message) {
super(message);
}

public StyleAlreadyLoadedException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** スタイルIDに対するスタイルが見つからなかった。 */
public class StyleNotFoundException extends IndexOutOfBoundsException {
public StyleNotFoundException(String message) {
super(message);
}

public StyleNotFoundException(String message, Throwable cause)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** OpenJTalkのユーザー辞書の設定に失敗した。 */
public class UseUserDictException extends RuntimeException {
public UseUserDictException(String message) {
super(message);
}

public UseUserDictException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package jp.hiroshiba.voicevoxcore.exceptions;

/** ユーザー辞書に単語が見つからなかった。 */
public class WordNotFoundException extends IndexOutOfBoundsException {
public WordNotFoundException(String message) {
super(message);
}

public WordNotFoundException(String message, Throwable cause)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
}
Loading
Loading