Skip to content
Snippets Groups Projects
Commit 3e302ac8 authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon: Committed by Yaroslav Dynnikov
Browse files

fix(migration): don't ignore migration apply errors

parent 4ef460e9
No related branches found
No related tags found
1 merge request!469fix(migration): don't ignore migration apply errors
Pipeline #16349 passed
......@@ -11,15 +11,21 @@ pub mod apply {
let storage = &node.storage;
match storage.migrations.get(req.migration_id)? {
Some(migration) => {
match lua_state().exec_with("box.execute(...)", migration.body) {
Ok(_) => Ok(Response{}),
Err(e) => Err(LuaError::from(e).into()),
}
}
None => Err(Error::other(format!("Migration {0} not found", req.migration_id))),
}
let Some(migration) = storage.migrations.get(req.migration_id)? else {
return Err(Error::other(format!("migration {0} not found", req.migration_id)));
};
lua_state()
.exec_with(
"local ok, err = box.execute(...)
if not ok then
box.error(err)
end",
migration.body,
)
.map_err(LuaError::from)?;
Ok(Response {})
}
pub struct Request {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment