You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When server create fails somewhere in the middle of the whole thing it leaves objects behind that have already been created. This is unlike the panel which always cleans up nicely.
to create a server. Not in API docs. You can observe this kind of behavior when user forgets to set --password in gscloud-server-create: new server object will be left while storage creation fails.
Ideas?
The text was updated successfully, but these errors were encountered:
@bkircher if you take a look at the "example" directory in gsclient-go package, you will see how to clean stuffs when there are errors during a process.
Do not use os.Exit directly (or indirectly through log.Fatal or other
helper functions) anymore.
Motivation: we need to clean up resources in error cases (see
#97). os.Exit makes the
program terminate immediately and deferred functions are not run. This
makes it impossible to use defer for cleaning up real resources when we
need to bail out.
This commit replaces all Run functions with RunE, returning errors from
now on in subcommands instead of exiting the process immediately. Other
functions use panic for errors that shouldn't actually happen.
This commit also introduces cmd.Error as a custom error type. It
contains a What message that should explain to the user what went wrong
and an Err error with all the details (probably from the API).
When server create fails somewhere in the middle of the whole thing it leaves objects behind that have already been created. This is unlike the panel which always cleans up nicely.
Panel uses POST /batch with
to create a server. Not in API docs. You can observe this kind of behavior when user forgets to set --password in gscloud-server-create: new server object will be left while storage creation fails.
Ideas?
The text was updated successfully, but these errors were encountered: