Skip to content

Commit

Permalink
Assign META0013 to DiscoveryError::BadResponse
Browse files Browse the repository at this point in the history
Most likely, a DiscoveryError::BadResponse is caused by an
incompatible service endpoint.
  • Loading branch information
tillrohrmann committed May 13, 2024
1 parent f0a291d commit e18e78e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions crates/errors/src/error_codes/META0013.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## META0013

Received a bad service discovery response from the specified service endpoint. This indicates that you are trying to register a service endpoint with an incompatible server.

Suggestions:

* Check the compatibility matrix between SDK and server versions
* Either deploy a server version which is compatible with your SDK
* Or use an SDK version which is compatible with your server
2 changes: 1 addition & 1 deletion crates/errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mod helper;

declare_restate_error_codes!(
RT0001, RT0002, RT0003, RT0004, RT0005, RT0006, RT0007, RT0009, RT0010, RT0011, RT0012,
META0003, META0004, META0005, META0006, META0009, META0010, META0011, META0012
META0003, META0004, META0005, META0006, META0009, META0010, META0011, META0012, META0013
);

// -- Some commonly used errors
Expand Down
4 changes: 2 additions & 2 deletions crates/service-protocol/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use hyper::http::response::Parts as ResponseParts;
use hyper::http::uri::PathAndQuery;
use hyper::http::{HeaderName, HeaderValue};
use hyper::{Body, HeaderMap, StatusCode};
use restate_errors::{META0003, META0012};
use restate_errors::{META0003, META0012, META0013};
use restate_schema_api::deployment::ProtocolType;
use restate_schema_api::MAX_SERVICE_PROTOCOL_VERSION_VALUE;
use restate_service_client::{Endpoint, Parts, Request, ServiceClient, ServiceClientError};
Expand Down Expand Up @@ -86,7 +86,7 @@ pub struct DiscoveredMetadata {
pub enum DiscoveryError {
// Errors most likely related to SDK bugs
#[error("received a bad response from the SDK: {0}")]
#[code(unknown)]
#[code(META0013)]
BadResponse(Cow<'static, str>),
#[error(
"received a bad response from the SDK that cannot be decoded: {0}. Discovery response: {}",
Expand Down

0 comments on commit e18e78e

Please sign in to comment.