Jonas/127 replace all panics by fatal error
- Création d'un commite par
crate
- Dans
lib/core/conf
ajout de commentaire pour les fonction ne pouvant pas utiliser la macrofatal_error
car le logger n'est pas encore initialisé. - Donc les seuls endroits où la macro
panic!
est encore utilisé:- avant l'initialisation du logger (donc la macro
fatal_error
😄 ). - dans les tests (unitaire et intégration)
- dans la crate
lib/core/core
car dev en cours https://git.duniter.org/nodes/rust/duniter-rs/tree/elois/ref-core-starter
- avant l'initialisation du logger (donc la macro
$ grep -nR "panic\!(" lib | grep -v "lib/core/core"
lib/core/conf/src/lib.rs:428: KeysAlgo::Schnorr => panic!("Schnorr algo not yet supported !"),
lib/core/conf/src/lib.rs:474: None => panic!("Impossible to get user config directory !"),
lib/core/conf/src/lib.rs:481: panic!(
lib/core/conf/src/lib.rs:582: panic!("Fatal error : keypairs file wrong format : no field salt !")
lib/core/conf/src/lib.rs:585: panic!("Fatal error : keypairs file wrong format : no field password !")
lib/core/conf/src/lib.rs:594: panic!("Fatal error : keypairs file wrong format : no field salt !")
lib/core/conf/src/lib.rs:597: panic!("Fatal error : keypairs file wrong format : no field password !")
lib/core/conf/src/lib.rs:600: panic!("Fail to read keypairs file !");
lib/core/conf/src/lib.rs:603: panic!("Fail to open keypairs file !");
lib/core/conf/src/lib.rs:612: panic!(dbg!("Fatal error : fail to write default keypairs file !"))
lib/core/conf/src/lib.rs:632: panic!(dbg!("Fatal error : fail to write conf file !"))
lib/core/conf/src/lib.rs:637: panic!("Fail to read conf file !");
lib/core/conf/src/lib.rs:640: panic!("Fail to open conf file !");
lib/core/conf/src/lib.rs:646: .unwrap_or_else(|_| panic!(dbg!("Fatal error : fail to write default conf file!")));
lib/core/conf/src/lib.rs:663: .unwrap_or_else(|_| panic!(dbg!("Fatal error : fail to deserialize keypairs !")))
lib/core/conf/src/lib.rs:711: None => panic!("Impossible to get your home dir!"),
lib/tools/common-tools/src/lib.rs:42: panic!($msg);
lib/tools/common-tools/src/lib.rs:46: panic!($msg);
lib/tools/common-tools/src/lib.rs:50: panic!($fmt, $($arg)+);
lib/tools/rules-engine/src/lib.rs:301: panic!("Rule creation must be fail")
lib/tools/network-documents/src/network_head_v3.rs:249: panic!("fail to sign head v3 : {:?}", sign_result.err().unwrap())
lib/tools/network-documents/src/network_peer.rs:324: panic!("fail to sign peer card : {:?}", sign_result.err().unwrap())
lib/modules/ws2p/ws2p-messages/lib.rs:236: panic!(
lib/modules/ws2p/ws2p-messages/lib.rs:242: panic!(
lib/modules/ws2p/ws2p/tests/connection_negociation.rs:125: panic!("Not receive client controller sender");
lib/modules/ws2p/ws2p/tests/connection_negociation.rs:146: panic!("Not receive server controller sender");
lib/modules/ws2p/ws2p/tests/connection_negociation.rs:181: panic!("Receive unexpected state: {:?} !", new_state);
lib/modules/ws2p/ws2p/tests/connection_negociation.rs:183: panic!("Expect signal ChangeConnectionState, receive other !");
lib/modules/ws2p/ws2p/src/controllers/incoming_connections/mod.rs:95: panic!("Listen error: {}", e);
Edited by Jonas SPRENGER