[Fix] Error Handling: Update setter methods to allow None values for type checks and enhance sensitive data handling in authentication failures.

This commit is contained in:
misyaguziya
2025-12-30 06:44:15 +09:00
parent 6014c2d362
commit 588b95eebe
5 changed files with 53 additions and 10 deletions

View File

@@ -279,11 +279,21 @@ def SELECTED_TAB_NO(self, value):
```
各setterは以下のパターンを実装:
1. 型チェック (`isinstance`)
1. 型チェック (`isinstance`)**`None` 値は常に許可される** (値をクリアしたい場合への対応)
2. 値の範囲・有効性チェック
3. 内部変数への代入
4. `saveConfig` 呼び出し(永続化対象の場合)
#### 型チェックの詳細v3.3.0+
```python
# 型チェック実装Noneは常に許可
if self.type_ is not None and value is not None and not isinstance(value, self.type_):
return # 無視する
```
この変更により、設定値をクリアNone に設定)する用途に対応。例えば認証失敗時に API キーを `None` に設定する場合に有効。
### メッセージフォーマット構造
```python