Skip to content

Commit 58d68e6

Browse files
committed
Better error handling
1 parent ad9587a commit 58d68e6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

share/sql/sql.go

+7
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,13 @@ func (m *mgr) getPath(ctx context.Context, resID *provider.ResourceId) (string,
329329
return "", err
330330
}
331331

332+
if res.Status.Code == rpc.Code_CODE_OK {
333+
return res.GetPath(), nil
334+
} else if res.Status.Code == rpc.Code_CODE_NOT_FOUND {
335+
return "", errtypes.NotFound(resID.OpaqueId)
336+
}
337+
return "", errors.New(res.Status.Code.String() + ": " + res.Status.Message)
338+
332339
return res.GetPath(), nil
333340
}
334341

0 commit comments

Comments
 (0)