상세점검 수정

This commit is contained in:
peregr1nus
2025-12-10 16:16:25 +09:00
parent 8019a7e4ba
commit 99857bbc12
3 changed files with 29 additions and 12 deletions

View File

@@ -37,7 +37,16 @@ class GoogleDriveUploader:
)
flow = InstalledAppFlow.from_client_secrets_file(
self.credentials_file, SCOPES)
creds = flow.run_local_server(port=0)
# 서버 환경에서는 브라우저가 없을 수 있으므로 예외 처리
try:
creds = flow.run_local_server(port=0)
except Exception as e:
# 브라우저를 열 수 없는 경우 (서버 환경 등)
# 토큰 파일이 이미 있다면 재시도하지 않고 예외 발생
raise Exception(
"구글 드라이브 인증을 완료할 수 없습니다. "
"로컬 환경에서 먼저 인증을 완료하여 token.json 파일을 생성해주세요."
) from e
# 토큰 저장
with open(self.token_file, 'wb') as token: