[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user