Skip to content
Commit 1668ce6d authored by Ed Tanous's avatar Ed Tanous Committed by Ed Tanous
Browse files

Move error messages to string_view

using std::string_view on these lets us call them in more contexts, and
allows us to inline some previously more complex code.  In general, for
APIs like this, std::string_view should be preferred as it gives more
flexibility in calling conventions.

Tested:
curl --insecure "https://localhost:18080/redfish/v1/AccountService/Roles/foobar"                                                     


{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type Role named 'foobar' was not found.",
        "MessageArgs": [
          "Role",
          "foobar"
        ],
        "MessageId": "Base.1.11.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.11.0.ResourceNotFound",
    "message": "The requested resource of type Role named 'foobar' was not found."
  }
}

This is the same response as previously.

Signed-off-by: default avatarEd Tanous <edtanous@google.com>
Change-Id: I8ee17120c42d2a13677648c3395aa4f9ec2bd51a
parent b6cd31e1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment