Skip to content

Commit 5b232f9

Browse files
author
Guillaume Chau
committedMay 3, 2018
fix(ui): unhandled auto project open error
1 parent 8992e7b commit 5b232f9

File tree

1 file changed

+9
-3
lines changed
  • packages/@vue/cli-ui/src/graphql-api/connectors

1 file changed

+9
-3
lines changed
 

‎packages/@vue/cli-ui/src/graphql-api/connectors/projects.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ async function open (id, context) {
312312
}).value()
313313

314314
if (!project) {
315-
console.warn(`Project '${id}' not found`)
315+
log('Project not found', id)
316316
return null
317317
}
318318

@@ -359,14 +359,20 @@ function setFavorite ({ id, favorite }, context) {
359359
}
360360

361361
// Open last project
362-
{
362+
async function autoOpenLastProject () {
363363
const context = getContext(null)
364364
const id = context.db.get('config.lastOpenProject').value()
365365
if (id) {
366-
open(id, context)
366+
try {
367+
await open(id, context)
368+
} catch (e) {
369+
log(`Project can't be auto-opened`, id)
370+
}
367371
}
368372
}
369373

374+
autoOpenLastProject()
375+
370376
module.exports = {
371377
list,
372378
getCurrent,

0 commit comments

Comments
 (0)
Please sign in to comment.