♻️ (pagetop): initialize() devuelve Result sin panic
`Extension::initialize()` devuelve `Result<(), BoxError>`; `BoxError` es un nuevo alias. Si una extensión falla, `prepare()` registra el error con sus causas, vuelca las trazas, lo repite en stderr y termina con código 1, sin panic! ni cambiar su firma.
This commit is contained in:
parent
728a5c83dc
commit
d3a9be7550
14 changed files with 199 additions and 110 deletions
|
|
@ -78,8 +78,9 @@ impl Extension for MyApp {
|
|||
]
|
||||
}
|
||||
|
||||
async fn initialize(&self) {
|
||||
install_migrations!(m20240101_000001_create_users);
|
||||
async fn initialize(&self) -> Result<(), BoxError> {
|
||||
install_migrations!(m20240101_000001_create_users)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue