github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbfs/libkbfs/bserver_error.go (about) 1 // Copyright 2016 Keybase Inc. All rights reserved. 2 // Use of this source code is governed by a BSD 3 // license that can be found in the LICENSE file. 4 5 package libkbfs 6 7 import "github.com/keybase/client/go/kbfs/kbfsblock" 8 9 func translateToBlockServerError(err error) error { 10 // TODO: Translate blockContextMismatchError, too, if the 11 // actual server returns a similar error. 12 switch err := err.(type) { 13 case blockNonExistentError: 14 return kbfsblock.ServerErrorBlockNonExistent{Msg: err.Error()} 15 default: 16 return err 17 } 18 }