Skip to content

Commit 146e6c5

Browse files
committed
Improve code consistency
1 parent 801729e commit 146e6c5

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

vminitd/Sources/vminitd/Server+GRPC.swift

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ extension Initd: Com_Apple_Containerization_Sandbox_V3_SandboxContextAsyncProvid
561561
])
562562
switch err.code {
563563
case .notFound:
564-
throw GRPCStatus(code: .notFound, message: "killProcess: \(err)")
564+
throw GRPCStatus(code: .notFound, message: "killProcess: failed to kill process: \(err)")
565565
default:
566566
throw GRPCStatus(code: .internalError, message: "killProcess: failed to kill process: \(err)")
567567
}
@@ -620,9 +620,9 @@ extension Initd: Com_Apple_Containerization_Sandbox_V3_SandboxContextAsyncProvid
620620
])
621621
switch err.code {
622622
case .notFound:
623-
throw GRPCStatus(code: .notFound, message: "deleteProcess: \(err)")
623+
throw GRPCStatus(code: .notFound, message: "deleteProcess: failed to delete process: \(err)")
624624
default:
625-
throw GRPCStatus(code: .internalError, message: "deleteProcess: \(err)")
625+
throw GRPCStatus(code: .internalError, message: "deleteProcess: failed to delete process: \(err)")
626626
}
627627
} catch {
628628
log.error(
@@ -673,15 +673,9 @@ extension Initd: Com_Apple_Containerization_Sandbox_V3_SandboxContextAsyncProvid
673673
])
674674
switch err.code {
675675
case .notFound:
676-
throw GRPCStatus(
677-
code: .notFound,
678-
message: "startProcess: \(err)"
679-
)
676+
throw GRPCStatus(code: .notFound, message: "startProcess: failed to start process: \(err)")
680677
default:
681-
throw GRPCStatus(
682-
code: .internalError,
683-
message: "startProcess: failed to start process: \(err)"
684-
)
678+
throw GRPCStatus(code: .internalError, message: "startProcess: failed to start process: \(err)")
685679
}
686680
} catch {
687681
log.error(
@@ -777,15 +771,9 @@ extension Initd: Com_Apple_Containerization_Sandbox_V3_SandboxContextAsyncProvid
777771
])
778772
switch err.code {
779773
case .notFound:
780-
throw GRPCStatus(
781-
code: .notFound,
782-
message: "waitProcess: \(err)"
783-
)
774+
throw GRPCStatus(code: .notFound, message: "waitProcess: failed to wait on process: \(err)")
784775
default:
785-
throw GRPCStatus(
786-
code: .internalError,
787-
message: "waitProcess: failed to wait on process: \(err)"
788-
)
776+
throw GRPCStatus(code: .internalError, message: "waitProcess: failed to wait on process: \(err)")
789777
}
790778
} catch {
791779
log.error(

0 commit comments

Comments
 (0)