cue-labs / oci

Go modules related to OCI (Open Container Initiative) registries
Apache License 2.0
24 stars 4 forks source link

ociserver: error creation causes duplicate code prefix #31

Closed rogpeppe closed 8 months ago

rogpeppe commented 8 months ago

With the recent change to use ociregistry.WireError as the common implementation of oci.Error, the error message contains the error code as a prefix. When an error is marshaled by ociserver for sending back to the client, that prefix remains in the message. However, ociclient also adds the prefix when it creates a WireError from the JSON representation, leading to a duplicate error code prefix.

The ociserver implementation should probably strip the error code prefix from the message before marshaling it.