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
* feat: add error code unauthorized
This makes it possible to check for an invalid token using
`hcloud.IsError(err, hcloud.ErrorCodeUnauthorized)`.
* docs: cleanup error codes comments
The "header" comment previously showed up for the first error code of
that category. By adding an empty line inbetween the two are no longer
connected.
By using "Deprecated: " tooling will automatically show a deprecation
warning for the `ErrorCodeLimitReached` constant.
ErrorUnsupportedErrorErrorCode="unsupported_error"// The given resource does not support this
30
31
31
32
// Server related error codes.
33
+
32
34
ErrorCodeInvalidServerTypeErrorCode="invalid_server_type"// The server type does not fit for the given server or is deprecated
33
35
ErrorCodeServerNotStoppedErrorCode="server_not_stopped"// The action requires a stopped server
34
36
ErrorCodeNetworksOverlapErrorCode="networks_overlap"// The network IP range overlaps with one of the server networks
35
37
ErrorCodePlacementErrorErrorCode="placement_error"// An error during the placement occurred
36
38
ErrorCodeServerAlreadyAttachedErrorCode="server_already_attached"// The server is already attached to the resource
37
39
38
40
// Load Balancer related error codes.
41
+
39
42
ErrorCodeIPNotOwnedErrorCode="ip_not_owned"// The IP you are trying to add as a target is not owned by the Project owner
40
43
ErrorCodeSourcePortAlreadyUsedErrorCode="source_port_already_used"// The source port you are trying to add is already in use
41
44
ErrorCodeCloudResourceIPNotAllowedErrorCode="cloud_resource_ip_not_allowed"// The IP you are trying to add as a target belongs to a Hetzner Cloud resource
@@ -47,15 +50,18 @@ const (
47
50
ErrorCodeLoadBalancerNotAttachedToNetworkErrorCode="load_balancer_not_attached_to_network"// The Load Balancer is not attached to a network
48
51
49
52
// Network related error codes.
53
+
50
54
ErrorCodeIPNotAvailableErrorCode="ip_not_available"// The provided Network IP is not available
51
55
ErrorCodeNoSubnetAvailableErrorCode="no_subnet_available"// No Subnet or IP is available for the Load Balancer/Server within the network
52
56
ErrorCodeVSwitchAlreadyUsedErrorCode="vswitch_id_already_used"// The given Robot vSwitch ID is already registered in another network
53
57
54
58
// Volume related error codes.
59
+
55
60
ErrorCodeNoSpaceLeftInLocationErrorCode="no_space_left_in_location"// There is no volume space left in the given location
56
61
ErrorCodeVolumeAlreadyAttachedErrorCode="volume_already_attached"// Volume is already attached to a server, detach first
57
62
58
63
// Firewall related error codes.
64
+
59
65
ErrorCodeFirewallAlreadyAppliedErrorCode="firewall_already_applied"// Firewall was already applied on resource
60
66
ErrorCodeFirewallAlreadyRemovedErrorCode="firewall_already_removed"// Firewall was already removed from the resource
61
67
ErrorCodeIncompatibleNetworkTypeErrorCode="incompatible_network_type"// The Network type is incompatible for the given resource
@@ -64,6 +70,7 @@ const (
64
70
ErrorCodeFirewallResourceNotFoundErrorCode="firewall_resource_not_found"// Resource a firewall should be attached to / detached from not found
65
71
66
72
// Certificate related error codes.
73
+
67
74
ErrorCodeCAARecordDoesNotAllowCAErrorCode="caa_record_does_not_allow_ca"// CAA record does not allow certificate authority
68
75
ErrorCodeCADNSValidationFailedErrorCode="ca_dns_validation_failed"// Certificate Authority: DNS validation failed
69
76
ErrorCodeCATooManyAuthorizationsFailedRecentlyErrorCode="ca_too_many_authorizations_failed_recently"// Certificate Authority: Too many authorizations failed recently
@@ -72,12 +79,13 @@ const (
72
79
ErrorCodeCloudNotVerifyDomainDelegatedToZoneErrorCode="could_not_verify_domain_delegated_to_zone"// Could not verify domain delegated to zone
73
80
ErrorCodeDNSZoneNotFoundErrorCode="dns_zone_not_found"// DNS zone not found
74
81
75
-
// Deprecated error codes
76
-
// The actual value of this error code is limit_reached. The new error code
77
-
// rate_limit_exceeded for ratelimiting was introduced before Hetzner Cloud
78
-
// launched into the public. To make clients using the old error code still
79
-
// work as expected, we set the value of the old error code to that of the
80
-
// new error code.
82
+
// Deprecated error codes.
83
+
84
+
// Deprecated: The actual value of this error code is limit_reached. The
85
+
// new error code rate_limit_exceeded for rate limiting was introduced
86
+
// before Hetzner Cloud launched into the public. To make clients using the
87
+
// old error code still work as expected, we set the value of the old error
0 commit comments