WeixuanZ / flood-warning-system

Exception caught is very general PYL-W0703
Anti-pattern
Major
5 occurrences in this check
Catching too general exception Exception
523                    batch_size=256,
524                    epoch=20,
525                )
526            except Exception:527                logger.error("NN prediction failed")
528                date, level = ([], []), ([], [], [])
529            predict_plot = plot_prediction(date, level)
Catching too general exception Exception
 52                float(e["stageScale"]["typicalRangeLow"]),
 53                float(e["stageScale"]["typicalRangeHigh"]),
 54            )
 55        except Exception: 56            typical_range = None
 57
 58        try:
Catching too general exception Exception
 68                town=town,
 69            )
 70            stations.append(s)
 71        except Exception: 72            # Not all required data on the station was available, so
 73            # skip over
 74            pass
Catching too general exception Exception
225    if use_pretrained:
226        try:
227            model = keras.models.load_model("./cache/{}.hdf5".format(station_name))
228        except Exception:229            print(
230                "No pre-trained model for {} found, training a model for it now.".format(
231                    station_name
Catching too general exception Exception
173        try:
174            levels.append(measure["value"])
175            dates.append(d)
176        except Exception:177            continue
178
179    return dates, levels