Skip to content

Commit 5da9acb

Browse files
committed
libsql: Improve sync protocol probe error handling
If we have an invalid access token, let's continue with gRPC protocol, because it produces odd error messages.
1 parent d980ce1 commit 5da9acb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

libsql/src/database/builder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ cfg_replication! {
381381
.await
382382
.map_err(|err| crate::Error::Sync(err.into()))?;
383383

384+
if res.status() == http::StatusCode::UNAUTHORIZED {
385+
return Err(crate::Error::Sync("Unauthorized".into()));
386+
}
387+
384388
if matches!(p, SyncProtocol::V2) {
385389
if !res.status().is_success() {
386390
let status = res.status();

0 commit comments

Comments
 (0)