From 68dcd0e0d2e921c64725cc0b30b41deb4095ccf1 Mon Sep 17 00:00:00 2001 From: denkhaus Date: Sat, 7 Jan 2017 12:37:15 +0100 Subject: [PATCH] autopush@1483789035 --- user.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/user.go b/user.go index c6bf082..05b30a2 100644 --- a/user.go +++ b/user.go @@ -24,6 +24,19 @@ func (p *Engine) completeUsers(db *neoism.Database) error { logger.Infof("%d user ids need completion -> fetch", len(ids)) twUsers, err := p.api.GetUsersLookupByIds(ids, nil) if err != nil { + if apiErr, ok := err.(*anaconda.ApiError); ok { + + if apiErr.StatusCode == 404 { + logger.Infof("mark user #%s as protected", idStr) + _, err = p.execQuery(db, CYPHER_USER_SET_PROTECTED, neoism.Props{ + "id": idStr, + }) + if err != nil { + return errors.Annotate(err, "set user protected") + } + } + } + return errors.Annotate(err, "lookup users by ids") }