mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
workspace migration logs (#6038)
* workspace migration logs * add try catches around all the migrations
This commit is contained in:
parent
63754de659
commit
b4857c7a13
@ -49,8 +49,13 @@ export function init() {
|
||||
}
|
||||
|
||||
export function migrate(doc: CookieJar) {
|
||||
doc = migrateCookieId(doc);
|
||||
return doc;
|
||||
try {
|
||||
doc = migrateCookieId(doc);
|
||||
return doc;
|
||||
} catch (e) {
|
||||
console.log('[db] Error during cookie jar migration', e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
export async function create(patch: Partial<CookieJar>) {
|
||||
|
@ -224,10 +224,15 @@ export function newAuth(type: string, oldAuth: RequestAuthentication = {}): Requ
|
||||
}
|
||||
|
||||
export function migrate(doc: Request): Request {
|
||||
doc = migrateBody(doc);
|
||||
doc = migrateWeirdUrls(doc);
|
||||
doc = migrateAuthType(doc);
|
||||
return doc;
|
||||
try {
|
||||
doc = migrateBody(doc);
|
||||
doc = migrateWeirdUrls(doc);
|
||||
doc = migrateAuthType(doc);
|
||||
return doc;
|
||||
} catch (e) {
|
||||
console.log('[db] Error during request migration', e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
export function create(patch: Partial<Request> = {}) {
|
||||
|
@ -84,8 +84,13 @@ export function init(): BaseResponse {
|
||||
}
|
||||
|
||||
export async function migrate(doc: Response) {
|
||||
doc = await migrateBodyCompression(doc);
|
||||
return doc;
|
||||
try {
|
||||
doc = await migrateBodyCompression(doc);
|
||||
return doc;
|
||||
} catch (e) {
|
||||
console.log('[db] Error during response migration', e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
export function hookDatabaseInit(consoleLog: typeof console.log = console.log) {
|
||||
|
@ -78,8 +78,13 @@ export function init(): BaseSettings {
|
||||
}
|
||||
|
||||
export function migrate(doc: Settings) {
|
||||
doc = migrateEnsureHotKeys(doc);
|
||||
return doc;
|
||||
try {
|
||||
doc = migrateEnsureHotKeys(doc);
|
||||
return doc;
|
||||
} catch (e) {
|
||||
console.log('[db] Error during settings migration', e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
export async function all() {
|
||||
|
@ -51,14 +51,19 @@ export const init = (): BaseWorkspace => ({
|
||||
});
|
||||
|
||||
export async function migrate(doc: Workspace) {
|
||||
doc = await _migrateExtractClientCertificates(doc);
|
||||
doc = await _migrateEnsureName(doc);
|
||||
await models.apiSpec.getOrCreateForParentId(doc._id, {
|
||||
fileName: doc.name,
|
||||
});
|
||||
doc = _migrateScope(doc);
|
||||
doc = _migrateIntoDefaultProject(doc);
|
||||
return doc;
|
||||
try {
|
||||
doc = await _migrateExtractClientCertificates(doc);
|
||||
doc = await _migrateEnsureName(doc);
|
||||
await models.apiSpec.getOrCreateForParentId(doc._id, {
|
||||
fileName: doc.name,
|
||||
});
|
||||
doc = _migrateScope(doc);
|
||||
doc = _migrateIntoDefaultProject(doc);
|
||||
return doc;
|
||||
} catch (e) {
|
||||
console.log('[db] Error during workspace migration', e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
export function getById(id?: string) {
|
||||
|
Loading…
Reference in New Issue
Block a user