Skip to content

Session expiration shows raw DioException instead of user-friendly message #2989

@Kalana-Gayan

Description

@Kalana-Gayan

Is there an existing issue for this? (Please read the description)

  • I have searched the existing issues

Current Behavior

When the Spotify session expires, the app throws a raw error:

DioException [bad response]: status code 401

Instead of handling this gracefully, the error is shown directly to the user.

Expected Behavior

The app should detect a 401 Unauthorized response and either:

Automatically refresh the session, or
Prompt the user to log in again with a clear message (e.g., "Session expired")
Actual behavior:
A technical error message is displayed, which is confusing for non-technical users.

Steps to reproduce

Log into Spotube
Wait until the session expires
Try to play a song
Error appears

Logs

Logs
DioException [bad response]: This exception was thrown because the response has a status code of 401 and RequestOptions.validateStatus was configured to throw for this status code. The status code of 401 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled" Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.

Operating System

Linux

Spotube version

v5.1.1

Installation source

Website (spotube.krtirtho.dev)

Additional information

No response

Self grab

  • I'm ready to work on this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions