@@ -37,8 +37,8 @@ func composeErrorMsg(msg string, cause error) string {
37
37
38
38
// CommandError is an error that may be converted into a gRPC status.
39
39
type CommandError interface {
40
- // ToRPCStatus convertes the error into a *status.Status
41
- ToRPCStatus () * status.Status
40
+ // GRPCStatus convertes the error into a *status.Status
41
+ GRPCStatus () * status.Status
42
42
}
43
43
44
44
// InvalidInstanceError is returned if the instance used in the command is not valid.
@@ -48,8 +48,8 @@ func (e *InvalidInstanceError) Error() string {
48
48
return tr ("Invalid instance" )
49
49
}
50
50
51
- // ToRPCStatus converts the error into a *status.Status
52
- func (e * InvalidInstanceError ) ToRPCStatus () * status.Status {
51
+ // GRPCStatus converts the error into a *status.Status
52
+ func (e * InvalidInstanceError ) GRPCStatus () * status.Status {
53
53
return status .New (codes .InvalidArgument , e .Error ())
54
54
}
55
55
@@ -62,8 +62,8 @@ func (e *InvalidFQBNError) Error() string {
62
62
return composeErrorMsg (tr ("Invalid FQBN" ), e .Cause )
63
63
}
64
64
65
- // ToRPCStatus converts the error into a *status.Status
66
- func (e * InvalidFQBNError ) ToRPCStatus () * status.Status {
65
+ // GRPCStatus converts the error into a *status.Status
66
+ func (e * InvalidFQBNError ) GRPCStatus () * status.Status {
67
67
return status .New (codes .InvalidArgument , e .Error ())
68
68
}
69
69
@@ -80,8 +80,8 @@ func (e *InvalidURLError) Error() string {
80
80
return composeErrorMsg (tr ("Invalid URL" ), e .Cause )
81
81
}
82
82
83
- // ToRPCStatus converts the error into a *status.Status
84
- func (e * InvalidURLError ) ToRPCStatus () * status.Status {
83
+ // GRPCStatus converts the error into a *status.Status
84
+ func (e * InvalidURLError ) GRPCStatus () * status.Status {
85
85
return status .New (codes .InvalidArgument , e .Error ())
86
86
}
87
87
@@ -98,8 +98,8 @@ func (e *InvalidLibraryError) Error() string {
98
98
return composeErrorMsg (tr ("Invalid library" ), e .Cause )
99
99
}
100
100
101
- // ToRPCStatus converts the error into a *status.Status
102
- func (e * InvalidLibraryError ) ToRPCStatus () * status.Status {
101
+ // GRPCStatus converts the error into a *status.Status
102
+ func (e * InvalidLibraryError ) GRPCStatus () * status.Status {
103
103
return status .New (codes .InvalidArgument , e .Error ())
104
104
}
105
105
@@ -116,8 +116,8 @@ func (e *InvalidVersionError) Error() string {
116
116
return composeErrorMsg (tr ("Invalid version" ), e .Cause )
117
117
}
118
118
119
- // ToRPCStatus converts the error into a *status.Status
120
- func (e * InvalidVersionError ) ToRPCStatus () * status.Status {
119
+ // GRPCStatus converts the error into a *status.Status
120
+ func (e * InvalidVersionError ) GRPCStatus () * status.Status {
121
121
return status .New (codes .InvalidArgument , e .Error ())
122
122
}
123
123
@@ -139,8 +139,8 @@ func (e *NoBoardsDetectedError) Error() string {
139
139
)
140
140
}
141
141
142
- // ToRPCStatus converts the error into a *status.Status
143
- func (e * NoBoardsDetectedError ) ToRPCStatus () * status.Status {
142
+ // GRPCStatus converts the error into a *status.Status
143
+ func (e * NoBoardsDetectedError ) GRPCStatus () * status.Status {
144
144
return status .New (codes .InvalidArgument , e .Error ())
145
145
}
146
146
@@ -159,8 +159,8 @@ func (e *MultipleBoardsDetectedError) Error() string {
159
159
)
160
160
}
161
161
162
- // ToRPCStatus converts the error into a *status.Status
163
- func (e * MultipleBoardsDetectedError ) ToRPCStatus () * status.Status {
162
+ // GRPCStatus converts the error into a *status.Status
163
+ func (e * MultipleBoardsDetectedError ) GRPCStatus () * status.Status {
164
164
return status .New (codes .InvalidArgument , e .Error ())
165
165
}
166
166
@@ -171,8 +171,8 @@ func (e *MissingFQBNError) Error() string {
171
171
return tr ("Missing FQBN (Fully Qualified Board Name)" )
172
172
}
173
173
174
- // ToRPCStatus converts the error into a *status.Status
175
- func (e * MissingFQBNError ) ToRPCStatus () * status.Status {
174
+ // GRPCStatus converts the error into a *status.Status
175
+ func (e * MissingFQBNError ) GRPCStatus () * status.Status {
176
176
return status .New (codes .InvalidArgument , e .Error ())
177
177
}
178
178
@@ -189,8 +189,8 @@ func (e *UnknownFQBNError) Unwrap() error {
189
189
return e .Cause
190
190
}
191
191
192
- // ToRPCStatus converts the error into a *status.Status
193
- func (e * UnknownFQBNError ) ToRPCStatus () * status.Status {
192
+ // GRPCStatus converts the error into a *status.Status
193
+ func (e * UnknownFQBNError ) GRPCStatus () * status.Status {
194
194
return status .New (codes .NotFound , e .Error ())
195
195
}
196
196
@@ -208,8 +208,8 @@ func (e *UnknownProfileError) Unwrap() error {
208
208
return e .Cause
209
209
}
210
210
211
- // ToRPCStatus converts the error into a *status.Status
212
- func (e * UnknownProfileError ) ToRPCStatus () * status.Status {
211
+ // GRPCStatus converts the error into a *status.Status
212
+ func (e * UnknownProfileError ) GRPCStatus () * status.Status {
213
213
return status .New (codes .NotFound , e .Error ())
214
214
}
215
215
@@ -226,8 +226,8 @@ func (e *InvalidProfileError) Unwrap() error {
226
226
return e .Cause
227
227
}
228
228
229
- // ToRPCStatus converts the error into a *status.Status
230
- func (e * InvalidProfileError ) ToRPCStatus () * status.Status {
229
+ // GRPCStatus converts the error into a *status.Status
230
+ func (e * InvalidProfileError ) GRPCStatus () * status.Status {
231
231
return status .New (codes .FailedPrecondition , e .Error ())
232
232
}
233
233
@@ -238,8 +238,8 @@ func (e *MissingPortAddressError) Error() string {
238
238
return tr ("Missing port address" )
239
239
}
240
240
241
- // ToRPCStatus converts the error into a *status.Status
242
- func (e * MissingPortAddressError ) ToRPCStatus () * status.Status {
241
+ // GRPCStatus converts the error into a *status.Status
242
+ func (e * MissingPortAddressError ) GRPCStatus () * status.Status {
243
243
return status .New (codes .InvalidArgument , e .Error ())
244
244
}
245
245
@@ -250,8 +250,8 @@ func (e *MissingPortProtocolError) Error() string {
250
250
return tr ("Missing port protocol" )
251
251
}
252
252
253
- // ToRPCStatus converts the error into a *status.Status
254
- func (e * MissingPortProtocolError ) ToRPCStatus () * status.Status {
253
+ // GRPCStatus converts the error into a *status.Status
254
+ func (e * MissingPortProtocolError ) GRPCStatus () * status.Status {
255
255
return status .New (codes .InvalidArgument , e .Error ())
256
256
}
257
257
@@ -262,8 +262,8 @@ func (e *MissingPortError) Error() string {
262
262
return tr ("Missing port" )
263
263
}
264
264
265
- // ToRPCStatus converts the error into a *status.Status
266
- func (e * MissingPortError ) ToRPCStatus () * status.Status {
265
+ // GRPCStatus converts the error into a *status.Status
266
+ func (e * MissingPortError ) GRPCStatus () * status.Status {
267
267
return status .New (codes .InvalidArgument , e .Error ())
268
268
}
269
269
@@ -276,8 +276,8 @@ func (e *NoMonitorAvailableForProtocolError) Error() string {
276
276
return tr ("No monitor available for the port protocol %s" , e .Protocol )
277
277
}
278
278
279
- // ToRPCStatus converts the error into a *status.Status
280
- func (e * NoMonitorAvailableForProtocolError ) ToRPCStatus () * status.Status {
279
+ // GRPCStatus converts the error into a *status.Status
280
+ func (e * NoMonitorAvailableForProtocolError ) GRPCStatus () * status.Status {
281
281
return status .New (codes .InvalidArgument , e .Error ())
282
282
}
283
283
@@ -288,8 +288,8 @@ func (e *MissingProgrammerError) Error() string {
288
288
return tr ("Missing programmer" )
289
289
}
290
290
291
- // ToRPCStatus converts the error into a *status.Status
292
- func (e * MissingProgrammerError ) ToRPCStatus () * status.Status {
291
+ // GRPCStatus converts the error into a *status.Status
292
+ func (e * MissingProgrammerError ) GRPCStatus () * status.Status {
293
293
s , _ := status .New (codes .InvalidArgument , e .Error ()).WithDetails (& rpc.MissingProgrammerError {})
294
294
return s
295
295
}
@@ -301,8 +301,8 @@ func (e *ProgrammerRequiredForUploadError) Error() string {
301
301
return tr ("A programmer is required to upload" )
302
302
}
303
303
304
- // ToRPCStatus converts the error into a *status.Status
305
- func (e * ProgrammerRequiredForUploadError ) ToRPCStatus () * status.Status {
304
+ // GRPCStatus converts the error into a *status.Status
305
+ func (e * ProgrammerRequiredForUploadError ) GRPCStatus () * status.Status {
306
306
st , _ := status .
307
307
New (codes .InvalidArgument , e .Error ()).
308
308
WithDetails (& rpc.ProgrammerIsRequiredForUploadError {})
@@ -320,8 +320,8 @@ func (ife *InitFailedError) Error() string {
320
320
return ife .Cause .Error ()
321
321
}
322
322
323
- // ToRPCStatus converts the error into a *status.Status
324
- func (ife * InitFailedError ) ToRPCStatus () * status.Status {
323
+ // GRPCStatus converts the error into a *status.Status
324
+ func (ife * InitFailedError ) GRPCStatus () * status.Status {
325
325
st , _ := status .
326
326
New (ife .Code , ife .Cause .Error ()).
327
327
WithDetails (& rpc.FailedInstanceInitError {
@@ -345,8 +345,8 @@ func (e *ProgrammerNotFoundError) Unwrap() error {
345
345
return e .Cause
346
346
}
347
347
348
- // ToRPCStatus converts the error into a *status.Status
349
- func (e * ProgrammerNotFoundError ) ToRPCStatus () * status.Status {
348
+ // GRPCStatus converts the error into a *status.Status
349
+ func (e * ProgrammerNotFoundError ) GRPCStatus () * status.Status {
350
350
return status .New (codes .NotFound , e .Error ())
351
351
}
352
352
@@ -364,8 +364,8 @@ func (e *MonitorNotFoundError) Unwrap() error {
364
364
return e .Cause
365
365
}
366
366
367
- // ToRPCStatus converts the error into a *status.Status
368
- func (e * MonitorNotFoundError ) ToRPCStatus () * status.Status {
367
+ // GRPCStatus converts the error into a *status.Status
368
+ func (e * MonitorNotFoundError ) GRPCStatus () * status.Status {
369
369
return status .New (codes .NotFound , e .Error ())
370
370
}
371
371
@@ -379,8 +379,8 @@ func (e *InvalidPlatformPropertyError) Error() string {
379
379
return tr ("Invalid '%[1]s' property: %[2]s" , e .Property , e .Value )
380
380
}
381
381
382
- // ToRPCStatus converts the error into a *status.Status
383
- func (e * InvalidPlatformPropertyError ) ToRPCStatus () * status.Status {
382
+ // GRPCStatus converts the error into a *status.Status
383
+ func (e * InvalidPlatformPropertyError ) GRPCStatus () * status.Status {
384
384
return status .New (codes .FailedPrecondition , e .Error ())
385
385
}
386
386
@@ -393,8 +393,8 @@ func (e *MissingPlatformPropertyError) Error() string {
393
393
return tr ("Property '%s' is undefined" , e .Property )
394
394
}
395
395
396
- // ToRPCStatus converts the error into a *status.Status
397
- func (e * MissingPlatformPropertyError ) ToRPCStatus () * status.Status {
396
+ // GRPCStatus converts the error into a *status.Status
397
+ func (e * MissingPlatformPropertyError ) GRPCStatus () * status.Status {
398
398
return status .New (codes .FailedPrecondition , e .Error ())
399
399
}
400
400
@@ -408,8 +408,8 @@ func (e *PlatformNotFoundError) Error() string {
408
408
return composeErrorMsg (tr ("Platform '%s' not found" , e .Platform ), e .Cause )
409
409
}
410
410
411
- // ToRPCStatus converts the error into a *status.Status
412
- func (e * PlatformNotFoundError ) ToRPCStatus () * status.Status {
411
+ // GRPCStatus converts the error into a *status.Status
412
+ func (e * PlatformNotFoundError ) GRPCStatus () * status.Status {
413
413
return status .New (codes .FailedPrecondition , e .Error ())
414
414
}
415
415
@@ -426,8 +426,8 @@ func (e *PlatformLoadingError) Error() string {
426
426
return composeErrorMsg (tr ("Error loading hardware platform" ), e .Cause )
427
427
}
428
428
429
- // ToRPCStatus converts the error into a *status.Status
430
- func (e * PlatformLoadingError ) ToRPCStatus () * status.Status {
429
+ // GRPCStatus converts the error into a *status.Status
430
+ func (e * PlatformLoadingError ) GRPCStatus () * status.Status {
431
431
s , _ := status .New (codes .FailedPrecondition , e .Error ()).
432
432
WithDetails (& rpc.PlatformLoadingError {})
433
433
return s
@@ -447,8 +447,8 @@ func (e *LibraryNotFoundError) Error() string {
447
447
return composeErrorMsg (tr ("Library '%s' not found" , e .Library ), e .Cause )
448
448
}
449
449
450
- // ToRPCStatus converts the error into a *status.Status
451
- func (e * LibraryNotFoundError ) ToRPCStatus () * status.Status {
450
+ // GRPCStatus converts the error into a *status.Status
451
+ func (e * LibraryNotFoundError ) GRPCStatus () * status.Status {
452
452
return status .New (codes .FailedPrecondition , e .Error ())
453
453
}
454
454
@@ -466,8 +466,8 @@ func (e *LibraryDependenciesResolutionFailedError) Error() string {
466
466
return composeErrorMsg (tr ("No valid dependencies solution found" ), e .Cause )
467
467
}
468
468
469
- // ToRPCStatus converts the error into a *status.Status
470
- func (e * LibraryDependenciesResolutionFailedError ) ToRPCStatus () * status.Status {
469
+ // GRPCStatus converts the error into a *status.Status
470
+ func (e * LibraryDependenciesResolutionFailedError ) GRPCStatus () * status.Status {
471
471
return status .New (codes .FailedPrecondition , e .Error ())
472
472
}
473
473
@@ -484,8 +484,8 @@ func (e *PlatformAlreadyAtTheLatestVersionError) Error() string {
484
484
return tr ("Platform '%s' is already at the latest version" , e .Platform )
485
485
}
486
486
487
- // ToRPCStatus converts the error into a *status.Status
488
- func (e * PlatformAlreadyAtTheLatestVersionError ) ToRPCStatus () * status.Status {
487
+ // GRPCStatus converts the error into a *status.Status
488
+ func (e * PlatformAlreadyAtTheLatestVersionError ) GRPCStatus () * status.Status {
489
489
st , _ := status .
490
490
New (codes .AlreadyExists , e .Error ()).
491
491
WithDetails (& rpc.AlreadyAtLatestVersionError {})
@@ -499,8 +499,8 @@ func (e *MissingSketchPathError) Error() string {
499
499
return tr ("Missing sketch path" )
500
500
}
501
501
502
- // ToRPCStatus converts the error into a *status.Status
503
- func (e * MissingSketchPathError ) ToRPCStatus () * status.Status {
502
+ // GRPCStatus converts the error into a *status.Status
503
+ func (e * MissingSketchPathError ) GRPCStatus () * status.Status {
504
504
return status .New (codes .InvalidArgument , e .Error ())
505
505
}
506
506
@@ -543,8 +543,8 @@ func (e *CantOpenSketchError) Unwrap() error {
543
543
return e .Cause
544
544
}
545
545
546
- // ToRPCStatus converts the error into a *status.Status
547
- func (e * CantOpenSketchError ) ToRPCStatus () * status.Status {
546
+ // GRPCStatus converts the error into a *status.Status
547
+ func (e * CantOpenSketchError ) GRPCStatus () * status.Status {
548
548
return status .New (codes .NotFound , e .Error ())
549
549
}
550
550
@@ -562,8 +562,8 @@ func (e *FailedInstallError) Unwrap() error {
562
562
return e .Cause
563
563
}
564
564
565
- // ToRPCStatus converts the error into a *status.Status
566
- func (e * FailedInstallError ) ToRPCStatus () * status.Status {
565
+ // GRPCStatus converts the error into a *status.Status
566
+ func (e * FailedInstallError ) GRPCStatus () * status.Status {
567
567
return status .New (codes .Internal , e .Error ())
568
568
}
569
569
@@ -580,8 +580,8 @@ func (e *FailedLibraryInstallError) Unwrap() error {
580
580
return e .Cause
581
581
}
582
582
583
- // ToRPCStatus converts the error into a *status.Status
584
- func (e * FailedLibraryInstallError ) ToRPCStatus () * status.Status {
583
+ // GRPCStatus converts the error into a *status.Status
584
+ func (e * FailedLibraryInstallError ) GRPCStatus () * status.Status {
585
585
return status .New (codes .Internal , e .Error ())
586
586
}
587
587
@@ -599,8 +599,8 @@ func (e *FailedUninstallError) Unwrap() error {
599
599
return e .Cause
600
600
}
601
601
602
- // ToRPCStatus converts the error into a *status.Status
603
- func (e * FailedUninstallError ) ToRPCStatus () * status.Status {
602
+ // GRPCStatus converts the error into a *status.Status
603
+ func (e * FailedUninstallError ) GRPCStatus () * status.Status {
604
604
return status .New (codes .Internal , e .Error ())
605
605
}
606
606
@@ -618,8 +618,8 @@ func (e *FailedDownloadError) Unwrap() error {
618
618
return e .Cause
619
619
}
620
620
621
- // ToRPCStatus converts the error into a *status.Status
622
- func (e * FailedDownloadError ) ToRPCStatus () * status.Status {
621
+ // GRPCStatus converts the error into a *status.Status
622
+ func (e * FailedDownloadError ) GRPCStatus () * status.Status {
623
623
return status .New (codes .Internal , e .Error ())
624
624
}
625
625
@@ -637,8 +637,8 @@ func (e *FailedUploadError) Unwrap() error {
637
637
return e .Cause
638
638
}
639
639
640
- // ToRPCStatus converts the error into a *status.Status
641
- func (e * FailedUploadError ) ToRPCStatus () * status.Status {
640
+ // GRPCStatus converts the error into a *status.Status
641
+ func (e * FailedUploadError ) GRPCStatus () * status.Status {
642
642
return status .New (codes .Internal , e .Error ())
643
643
}
644
644
@@ -656,8 +656,8 @@ func (e *FailedDebugError) Unwrap() error {
656
656
return e .Cause
657
657
}
658
658
659
- // ToRPCStatus converts the error into a *status.Status
660
- func (e * FailedDebugError ) ToRPCStatus () * status.Status {
659
+ // GRPCStatus converts the error into a *status.Status
660
+ func (e * FailedDebugError ) GRPCStatus () * status.Status {
661
661
return status .New (codes .Internal , e .Error ())
662
662
}
663
663
@@ -674,8 +674,8 @@ func (e *FailedMonitorError) Unwrap() error {
674
674
return e .Cause
675
675
}
676
676
677
- // ToRPCStatus converts the error into a *status.Status
678
- func (e * FailedMonitorError ) ToRPCStatus () * status.Status {
677
+ // GRPCStatus converts the error into a *status.Status
678
+ func (e * FailedMonitorError ) GRPCStatus () * status.Status {
679
679
return status .New (codes .Internal , e .Error ())
680
680
}
681
681
@@ -693,8 +693,8 @@ func (e *CompileFailedError) Unwrap() error {
693
693
return e .Cause
694
694
}
695
695
696
- // ToRPCStatus converts the error into a *status.Status
697
- func (e * CompileFailedError ) ToRPCStatus () * status.Status {
696
+ // GRPCStatus converts the error into a *status.Status
697
+ func (e * CompileFailedError ) GRPCStatus () * status.Status {
698
698
return status .New (codes .Internal , e .Error ())
699
699
}
700
700
@@ -712,8 +712,8 @@ func (e *InvalidArgumentError) Unwrap() error {
712
712
return e .Cause
713
713
}
714
714
715
- // ToRPCStatus converts the error into a *status.Status
716
- func (e * InvalidArgumentError ) ToRPCStatus () * status.Status {
715
+ // GRPCStatus converts the error into a *status.Status
716
+ func (e * InvalidArgumentError ) GRPCStatus () * status.Status {
717
717
return status .New (codes .InvalidArgument , e .Error ())
718
718
}
719
719
@@ -731,8 +731,8 @@ func (e *NotFoundError) Unwrap() error {
731
731
return e .Cause
732
732
}
733
733
734
- // ToRPCStatus converts the error into a *status.Status
735
- func (e * NotFoundError ) ToRPCStatus () * status.Status {
734
+ // GRPCStatus converts the error into a *status.Status
735
+ func (e * NotFoundError ) GRPCStatus () * status.Status {
736
736
return status .New (codes .NotFound , e .Error ())
737
737
}
738
738
@@ -750,8 +750,8 @@ func (e *PermissionDeniedError) Unwrap() error {
750
750
return e .Cause
751
751
}
752
752
753
- // ToRPCStatus converts the error into a *status.Status
754
- func (e * PermissionDeniedError ) ToRPCStatus () * status.Status {
753
+ // GRPCStatus converts the error into a *status.Status
754
+ func (e * PermissionDeniedError ) GRPCStatus () * status.Status {
755
755
return status .New (codes .PermissionDenied , e .Error ())
756
756
}
757
757
@@ -769,8 +769,8 @@ func (e *UnavailableError) Unwrap() error {
769
769
return e .Cause
770
770
}
771
771
772
- // ToRPCStatus converts the error into a *status.Status
773
- func (e * UnavailableError ) ToRPCStatus () * status.Status {
772
+ // GRPCStatus converts the error into a *status.Status
773
+ func (e * UnavailableError ) GRPCStatus () * status.Status {
774
774
return status .New (codes .Unavailable , e .Error ())
775
775
}
776
776
@@ -787,8 +787,8 @@ func (e *TempDirCreationFailedError) Unwrap() error {
787
787
return e .Cause
788
788
}
789
789
790
- // ToRPCStatus converts the error into a *status.Status
791
- func (e * TempDirCreationFailedError ) ToRPCStatus () * status.Status {
790
+ // GRPCStatus converts the error into a *status.Status
791
+ func (e * TempDirCreationFailedError ) GRPCStatus () * status.Status {
792
792
return status .New (codes .Unavailable , e .Error ())
793
793
}
794
794
@@ -805,8 +805,8 @@ func (e *TempFileCreationFailedError) Unwrap() error {
805
805
return e .Cause
806
806
}
807
807
808
- // ToRPCStatus converts the error into a *status.Status
809
- func (e * TempFileCreationFailedError ) ToRPCStatus () * status.Status {
808
+ // GRPCStatus converts the error into a *status.Status
809
+ func (e * TempFileCreationFailedError ) GRPCStatus () * status.Status {
810
810
return status .New (codes .Unavailable , e .Error ())
811
811
}
812
812
@@ -824,8 +824,8 @@ func (e *SignatureVerificationFailedError) Unwrap() error {
824
824
return e .Cause
825
825
}
826
826
827
- // ToRPCStatus converts the error into a *status.Status
828
- func (e * SignatureVerificationFailedError ) ToRPCStatus () * status.Status {
827
+ // GRPCStatus converts the error into a *status.Status
828
+ func (e * SignatureVerificationFailedError ) GRPCStatus () * status.Status {
829
829
return status .New (codes .Unavailable , e .Error ())
830
830
}
831
831
@@ -842,8 +842,8 @@ func (e *MultiplePlatformsError) Error() string {
842
842
len (e .Platforms ), e .UserPlatform , strings .Join (e .Platforms , ", " ))
843
843
}
844
844
845
- // ToRPCStatus converts the error into a *status.Status
846
- func (e * MultiplePlatformsError ) ToRPCStatus () * status.Status {
845
+ // GRPCStatus converts the error into a *status.Status
846
+ func (e * MultiplePlatformsError ) GRPCStatus () * status.Status {
847
847
return status .New (codes .InvalidArgument , e .Error ())
848
848
}
849
849
@@ -865,8 +865,8 @@ func (e *MultipleLibraryInstallDetected) Error() string {
865
865
return res
866
866
}
867
867
868
- // ToRPCStatus converts the error into a *status.Status
869
- func (e * MultipleLibraryInstallDetected ) ToRPCStatus () * status.Status {
868
+ // GRPCStatus converts the error into a *status.Status
869
+ func (e * MultipleLibraryInstallDetected ) GRPCStatus () * status.Status {
870
870
return status .New (codes .InvalidArgument , e .Error ())
871
871
}
872
872
@@ -878,8 +878,8 @@ func (e *InstanceNeedsReinitialization) Error() string {
878
878
return tr ("The instance is no longer valid and needs to be reinitialized" )
879
879
}
880
880
881
- // ToRPCStatus converts the error into a *status.Status
882
- func (e * InstanceNeedsReinitialization ) ToRPCStatus () * status.Status {
881
+ // GRPCStatus converts the error into a *status.Status
882
+ func (e * InstanceNeedsReinitialization ) GRPCStatus () * status.Status {
883
883
st , _ := status .
884
884
New (codes .InvalidArgument , e .Error ()).
885
885
WithDetails (& rpc.InstanceNeedsReinitializationError {})
0 commit comments