github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbfs/libfs/error.go (about) 1 // Copyright 2015-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 libfs 6 7 // Error defines errors with codes 8 type Error struct { 9 Code int 10 Message string 11 } 12 13 const ( 14 // InitErrorCode is the error code for initialization errors 15 InitErrorCode = 1 16 // MountErrorCode is the error code for mount errors 17 MountErrorCode = 2 18 ) 19 20 // InitError is for initialization errors 21 func InitError(message string) *Error { 22 return &Error{InitErrorCode, message} 23 } 24 25 // MountError is for mount errors 26 func MountError(message string) *Error { 27 return &Error{MountErrorCode, message} 28 }