Skip to content

Commit

Permalink
廃止: HTTP エラーと重複するエラーロギングを削除 (#1348)
Browse files Browse the repository at this point in the history
* remove: HTTP エラーと重複する `print_exc()` を削除

* fix: lint
  • Loading branch information
tarepan authored Jun 2, 2024
1 parent d908da7 commit f34da2f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions voicevox_engine/app/routers/speaker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""話者情報機能を提供する API Router"""

import base64
import traceback
from pathlib import Path
from typing import Annotated, Literal

Expand Down Expand Up @@ -126,7 +125,6 @@ def _speaker_info(
}
)
except FileNotFoundError:
traceback.print_exc()
msg = "追加情報が見つかりませんでした"
raise HTTPException(status_code=500, detail=msg)

Expand Down
6 changes: 0 additions & 6 deletions voicevox_engine/app/routers/user_dict.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""ユーザー辞書機能を提供する API Router"""

import traceback
from typing import Annotated

from fastapi import APIRouter, Body, Depends, HTTPException, Path, Query
Expand Down Expand Up @@ -35,7 +34,6 @@ def get_user_dict_words() -> dict[str, UserDictWord]:
except UserDictInputError as err:
raise HTTPException(status_code=422, detail=str(err))
except Exception:
traceback.print_exc()
raise HTTPException(
status_code=500, detail="辞書の読み込みに失敗しました。"
)
Expand Down Expand Up @@ -81,7 +79,6 @@ def add_user_dict_word(
except UserDictInputError as err:
raise HTTPException(status_code=422, detail=str(err))
except Exception:
traceback.print_exc()
raise HTTPException(
status_code=500, detail="ユーザー辞書への追加に失敗しました。"
)
Expand Down Expand Up @@ -132,7 +129,6 @@ def rewrite_user_dict_word(
except UserDictInputError as err:
raise HTTPException(status_code=422, detail=str(err))
except Exception:
traceback.print_exc()
raise HTTPException(
status_code=500, detail="ユーザー辞書の更新に失敗しました。"
)
Expand All @@ -153,7 +149,6 @@ def delete_user_dict_word(
except UserDictInputError as err:
raise HTTPException(status_code=422, detail=str(err))
except Exception:
traceback.print_exc()
raise HTTPException(
status_code=500, detail="ユーザー辞書の更新に失敗しました。"
)
Expand All @@ -180,7 +175,6 @@ def import_user_dict_words(
except UserDictInputError as err:
raise HTTPException(status_code=422, detail=str(err))
except Exception:
traceback.print_exc()
raise HTTPException(
status_code=500, detail="ユーザー辞書のインポートに失敗しました。"
)
Expand Down
2 changes: 0 additions & 2 deletions voicevox_engine/user_dict/user_dict_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import json
import sys
import threading
import traceback
from collections.abc import Callable
from pathlib import Path
from typing import Any, Final, TypeVar
Expand Down Expand Up @@ -160,7 +159,6 @@ def _update_dict(

except Exception as e:
print("Error: Failed to update dictionary.", file=sys.stderr)
traceback.print_exc(file=sys.stderr)
raise e

finally:
Expand Down

0 comments on commit f34da2f

Please sign in to comment.