github.com/racerxdl/gonx@v0.0.0-20210103083128-c5afc43bcbd2/nx/nxerrors/errors.go (about)

     1  package nxerrors
     2  
     3  type constError string
     4  
     5  func (err constError) Error() string {
     6  	return string(err)
     7  }
     8  
     9  func (err constError) String() string {
    10  	return string(err)
    11  }
    12  
    13  // Generic errors
    14  const (
    15  	NotImplemented            = constError("not implemented")
    16  	OutOfMemory               = constError("out of memory")
    17  	CannotSetMemoryAttributes = constError("cannot set memory attributes")
    18  	Timeout                   = constError("timeout")
    19  )
    20  
    21  // IPC Errors
    22  const (
    23  	TooManyHandles                    = constError("too many handles")
    24  	TooManyBuffers                    = constError("too many buffers")
    25  	UnsupportedBufferType             = constError("unsupported buffer type")
    26  	InvalidBufferAddress              = constError("invalid buffer address")
    27  	InvalidBufferSize                 = constError("invalid buffer size")
    28  	InvalidBufferFlags                = constError("invalid buffer flags")
    29  	InvalidRequestType                = constError("invalid request type")
    30  	InvalidDomain                     = constError("invalid domain")
    31  	InvalidHandle                     = constError("invalid handle")
    32  	CantSendDomainObjectToSession     = constError("cant send domain object to session")
    33  	TooManyObjects                    = constError("too many objects")
    34  	InvalidRawDataSize                = constError("invalid raw data size")
    35  	CantCloseSessionLikeDomainObjects = constError("can't close sessions like domain objects")
    36  	MalformedCloseRequest             = constError("malformed close request")
    37  	CantSendObjectAcrossDomains       = constError("can't send object across domains")
    38  	InvalidIPCResponseType            = constError("invalid ipc response type")
    39  	InvalidIPCResponseMagic           = constError("invalid ipc response magic")
    40  	UnexpectedRawDataSize             = constError("unexpected raw data size")
    41  	UnexpectedPID                     = constError("unexpected pid")
    42  	UnexpectedCopyHandles             = constError("unexpected copy handles")
    43  	UnexpectedMoveHandles             = constError("unexpected move handles")
    44  	UnexpectedObjects                 = constError("unexpected objects")
    45  	ExpectedSessionClosure            = constError("expected session closure")
    46  	RefusalToConvertBorrowedObject    = constError("refusal to convert borrowed object")
    47  	AlreadyADomain                    = constError("already a domain")
    48  )
    49  
    50  // SM Errors
    51  const (
    52  	SMNotInitialized     = constError("sm not initialized")
    53  	SMServiceNameTooLong = constError("sm service name too long")
    54  )
    55  
    56  // NV Errors
    57  const (
    58  	NVNotInitialized = constError("nv not initialized")
    59  )
    60  
    61  // GPU Errors
    62  const (
    63  	GPUNotInitialized  = constError("gpu not initialized")
    64  	GPUBufferUnaligned = constError("gpu buffer unaligned")
    65  )
    66  
    67  // VI Errors
    68  const (
    69  	VINotInitialized = constError("vi not initialized")
    70  	ParcelDataTooBig = constError("parcel data too big")
    71  )
    72  
    73  // AM Errors
    74  const (
    75  	AMNotInitialized  = constError("am not initialized")
    76  	UnknownAppletType = constError("unknown applet type")
    77  
    78  	AMBusy = 0x19280
    79  )
    80  
    81  // Display Errors
    82  const (
    83  	DisplayNotInitialized              = constError("display not initialized")
    84  	ParcelDataUnderrun                 = constError("parcel data underrun")
    85  	DisplayInvalidFence                = constError("invalid display fence")
    86  	DisplayFenceTooManyFds             = constError("too many display fence file descriptors")
    87  	DisplayGraphicBufferLengthMismatch = constError("display graphic buffer length mismatch")
    88  	SurfaceInvalidState                = constError("surface invalid state")
    89  	SurfaceBufferDequeueFailed         = constError("surface buffer dequeue failed")
    90  	SurfaceBufferQueueFailed           = constError("surface buffer queue failed")
    91  )
    92  
    93  // SM Errors
    94  const (
    95  	SmNotInitialized     = constError("sm not initialized")
    96  	SmServiceNameTooLong = constError("sm service name too long")
    97  )