mesos / mesos-go

Go language bindings for Apache Mesos
Apache License 2.0
544 stars 146 forks source link

Add a Code() method to apierrors.Error #379

Closed bamarni closed 4 years ago

bamarni commented 4 years ago

Being able to get the status code behind a Mesos error is necessary in order to fix:

https://jira.mesosphere.com/browse/DCOS_OSS-5432

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.04%) to 59.506% when pulling 92b4a9716dbae4ce400c61f7373e569e094906ca on bamarni:DCOS_OSS-5432 into 56ac038085ac996051390598b156bff1c6ef0d3d on mesos:master.

bamarni commented 4 years ago

Hum, not sure why it decreased, the method is covered in the test.

jdef commented 4 years ago

The Code type already has a Matches method, not sure why this addition is needed.

On Tue, Aug 6, 2019, 12:22 PM Bilal Amarni notifications@github.com wrote:

Hum, not sure why it decreased, the method is covered in the test.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mesos/mesos-go/pull/379?email_source=notifications&email_token=AAR5KLGMRNKY6B4AMPZFS2TQDGQLDA5CNFSM4IJX2CP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3VWAGQ#issuecomment-518742042, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR5KLDCBAPLWMOQZL3SZETQDGQLDANCNFSM4IJX2CPQ .

bamarni commented 4 years ago

@jdef : indeed I had missed this method, seems like I can create a 500 Code and invoke Match(err) as an alternative. Thanks!