Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ampache Resolver - Better Error Handling #115

Open
AshotN opened this issue Apr 20, 2016 · 0 comments
Open

Ampache Resolver - Better Error Handling #115

AshotN opened this issue Apr 20, 2016 · 0 comments
Assignees
Labels

Comments

@AshotN
Copy link

AshotN commented Apr 20, 2016

I've been spending some time trying to figure out why my ownCloud(Ampache) server will not authenticate. The resolver kept saying "Username or password incorrect." This led me to believe that I was just doing something wrong with ownCloud. But after several attempts I decided to dive into the code.

if (typeof error != 'undefined' && error.getAttribute("code") == "403") {
    return TomahawkConfigTestResultType.InvalidAccount;
} else {
    return TomahawkConfigTestResultType.InvalidCredentials;
}

The code only checked for a 403 and that's it... what I was getting instead was a 401

<error code=​"401">​Invalid Login - timestamp is in future​</error>​

I've just started reading through the code and I'm not sure what would be a good return value since the documentation suggests avoiding custom messages. I think resolvers should go through expected errors and then output the error itself to the user as a final resort. Much better than misleading errors.

EDIT:

Also ownCloud seems to be aware of this timestamp problem

// TODO - while testing with tomahawk it sometimes is $currenttime+1 ... needs further investigation
    if($providedTime > $currentTime + 100) {
        throw new AmpacheException('Invalid Login - timestamp is in future', 401);
    }

https://github.com/owncloud/music/blob/master/controller/ampachecontroller.php

EDIT 2: I got my ampache to work... my Linux system clock was somehow wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants