GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Do not require login unless 401 is received on push by crosbymichael · Pull Request #1298 · moby/moby

Conversation

@crosbymichael

@crosbymichael crosbymichael commented Jul 25, 2013

Copy link
Copy Markdown
Contributor

Added error details to the JSONMessage. The field name has changed but the json field tag's name for serialization is the same for backwards compat in the api.

Fixes #1246

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nisaacson

nisaacson commented Jul 25, 2013

Copy link
Copy Markdown

nice!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@keeb-zz

keeb-zz commented Jul 25, 2013

Copy link
Copy Markdown
Contributor

/cc @samalba

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samalba

samalba commented Jul 25, 2013

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vieux

vieux commented Jul 26, 2013

Copy link
Copy Markdown
Contributor

Hi michael, I see you renamed Error to ErrorMessage
My idea to keep compat was to leave Error untouched, and to add the new format with another name, otherwise, there is no need to keep the "deprecated format" as it's "new"

So as you prefer, either you remove ErrorMessage, either you rename ErrorMessage to Error like before and choose another name to your new format.

Does this makes sense to you ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@crosbymichael

crosbymichael commented Jul 26, 2013

Copy link
Copy Markdown
Contributor Author

I did keep the struct field tags the same so externally, via the api, it appears the same but internally we can name the fields what makes the most sense.

ErrorMessage string     `json:"error,omitempty"` //deprecated
Error        *JSONError `json:"errorDetail,omitempty"`

Does this change anything? Struct tags are a way for us to keep compat via the external API and still be able to refactor the internals. Granted, this is all depending on people not using the Go pkg currently to build tools around the docker core. Let me know if this is not the case.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vieux

vieux commented Jul 26, 2013

Copy link
Copy Markdown
Contributor

Oh sorry I didn't pay attention to the JSON. It's perfect like this.

On Fri, Jul 26, 2013 at 2:17 PM, Michael Crosby [email protected]:

I did keep the struct field tags the same so externally, via the api, it
appears the same but internally we can name the fields what makes the most
sense.

ErrorMessage string json:"error,omitempty" //deprecated
Error *JSONError json:"errorDetail,omitempty"

Does this change anything? Struct tags are a way for us to keep compat via
the external API and still be able to refactor the internals. Granted, this
is all depending on people not using the Go pkg currently to build tools
around the docker core. Let me know if this is not the case.

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/1298#issuecomment-21617008
.

Victor VIEUX
http://vvieux.com

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@creack

creack commented Jul 27, 2013

Copy link
Copy Markdown
Contributor

The types HTTPRequestError and JSONError seem redundant, can't we use the same one?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@creack

creack commented Jul 27, 2013

Copy link
Copy Markdown
Contributor

Instead of adding an argument to FromatError, wouldn't it be better to use a type assertion?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

creack
creack reviewed Jul 27, 2013
View reviewed changes
Comment thread commands.go Outdated

@creack creack Jul 27, 2013

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the type 'error' is not required here and golint will ask for it to be removed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@crosbymichael
Return registy status code in error
3043c26
Added Details map to the JSONMessage
creack
creack reviewed Aug 3, 2013
View reviewed changes
Comment thread utils/utils.go Outdated

@creack creack Aug 3, 2013

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simply doing something like this?

jsonError, ok := err.(*JSONError)
if !ok {
    jsonError = &JSONError
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@crosbymichael
Return JSONError for HTTPResponse error
dae585c
@creack

creack commented Aug 3, 2013

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

creack added a commit that referenced this pull request Aug 3, 2013
@creack
Merge pull request #1298 from crosbymichael/1246-auth-request
4dcc0f3
* Registry: Do not require login unless 401 is received on push
@creack
creack merged commit 4dcc0f3 into moby:master Aug 3, 2013
@crosbymichael
crosbymichael deleted the 1246-auth-request branch August 3, 2013 04:09
@crosbymichael crosbymichael mentioned this pull request Aug 5, 2013
Missing error description after push with wrong credentials #1393
Closed
This was referenced Jan 10, 2023
api: swagger: add errorDetail to CreateImageInfo #44061
Merged
api: swagger: review (JSON)stream response types #44783
Open
@thaJeztah thaJeztah mentioned this pull request Apr 30, 2023
pkg/jsonmessage: JSONMessage.Display(): remove special case for 401 errors #45442
Merged
This was referenced Jan 13, 2025
pkg/jsonmessage: stop printing deprecated progressDetail, errorDetail, remove DisplayJSONMessagesToStream and Stream interface #49264
Merged
image load: don't depend on deprecated JSONMessage.error field docker/docker-py#3307
Merged
@thaJeztah thaJeztah mentioned this pull request Feb 11, 2025
Fix deprecation of "error" and "progress" fields in streaming responses #49447
Merged
@thaJeztah thaJeztah mentioned this pull request Aug 18, 2025
api: remaining bits for jsonstream, jsonmessage, progress cleanup #50575
Open
@thaJeztah thaJeztah added area/api API area/distribution Image Distribution area/authentication labels Nov 4, 2026
@thaJeztah thaJeztah mentioned this pull request Nov 4, 2026
streamformatter: handle wrapped errors and remove uses of deprecated "errors" field #54124
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area/api API area/authentication area/distribution Image Distribution

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

docker forces login even for self-hosted registry

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@crosbymichael @nisaacson @keeb-zz @samalba @vieux @creack @thaJeztah
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.