mirror of
https://github.com/unraid/api.git
synced 2026-01-01 06:01:18 -06:00
fix: apply and rollback error handling
This commit is contained in:
@@ -32,12 +32,8 @@ export class UnraidFileModificationService implements OnModuleInit, OnModuleDest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async onModuleDestroy() {
|
async onModuleDestroy() {
|
||||||
try {
|
this.logger.log('Rolling back all modifications...');
|
||||||
this.logger.log('Rolling back all modifications...');
|
await this.rollbackAll();
|
||||||
await this.rollbackAll();
|
|
||||||
} catch (err) {
|
|
||||||
this.logger.error(`Failed to roll back modifications: ${err}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -90,7 +86,6 @@ export class UnraidFileModificationService implements OnModuleInit, OnModuleDest
|
|||||||
} else {
|
} else {
|
||||||
this.logger.error(`Failed to apply modification: ${modification.id}: ${error}`);
|
this.logger.error(`Failed to apply modification: ${modification.id}: ${error}`);
|
||||||
}
|
}
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,6 +115,4 @@ export class UnraidFileModificationService implements OnModuleInit, OnModuleDest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user