fix: harden endpoints against malformed input (final-review findings)
- /api/repeaters: bad ?limit= falls back to 25 instead of crashing the handler
- repeaters.load(): tolerate a corrupted repeaters.json (JSONDecodeError -> [])
- tune_repeater/do_POST: catch TypeError so a null field yields {ok:false} not a reset
This commit is contained in:
@@ -196,7 +196,7 @@ class Radio:
|
||||
def attempt(name, fn):
|
||||
try:
|
||||
fn(); steps[name] = True
|
||||
except (CIVError, ValueError, OSError) as e:
|
||||
except (CIVError, ValueError, TypeError, OSError) as e:
|
||||
steps[name] = False; errors[name] = str(e)
|
||||
|
||||
attempt("freq", lambda: self.set_frequency(int(round(rec["output_mhz"] * 1e6))))
|
||||
|
||||
Reference in New Issue
Block a user