-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of github.com:wireapp/wire-webapp into yarn-stuff
* 'dev' of github.com:wireapp/wire-webapp: eslint no-else-return rule (#954) Reenable Firefox 45 for ESR support but disable calling Calling v3 optimizations (WEBAPP-3772) (#937) ES6: Migrated "auth" directory (#947) ES6: Migrated GeoLocation (#951)
- Loading branch information
Showing
51 changed files
with
1,491 additions
and
1,079 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2016 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
window.z = window.z || {}; | ||
window.z.auth = z.audio || {}; | ||
|
||
window.z.auth.AccessTokenError = class AccessTokenError extends Error { | ||
constructor(type) { | ||
super(); | ||
this.name = this.constructor.name; | ||
this.stack = (new Error()).stack; | ||
this.type = type || z.audio.AccessTokenError.TYPE.UNKNOWN; | ||
|
||
switch (this.type) { | ||
case z.auth.AccessTokenError.TYPE.NOT_FOUND_IN_CACHE: | ||
this.message = 'No cached access token found in Local Storage'; | ||
break; | ||
case z.auth.AccessTokenError.TYPE.REFRESH_IN_PROGRESS: | ||
this.message = 'Access Token request already in progress'; | ||
break; | ||
case z.auth.AccessTokenError.TYPE.RETRIES_EXCEEDED: | ||
this.message = 'No. of retries to get Access Token exceeded'; | ||
break; | ||
case z.auth.AccessTokenError.TYPE.REQUEST_FAILED: | ||
this.message = 'Request to POST for access token failed'; | ||
break; | ||
case z.auth.AccessTokenError.TYPE.REQUEST_FORBIDDEN: | ||
this.message = 'Request to POST for access token forbidden'; | ||
break; | ||
} | ||
} | ||
|
||
static get TYPE() { | ||
return { | ||
NOT_FOUND_IN_CACHE: 'z.auth.AccessTokenError.TYPE.NOT_FOUND_IN_CACHE', | ||
REFRESH_IN_PROGRESS: 'z.auth.AccessTokenError.TYPE.REFRESH_IN_PROGRESS', | ||
REQUEST_FAILED: 'z.auth.AccessTokenError.TYPE.REQUEST_FAILED', | ||
REQUEST_FORBIDDEN: 'z.auth.AccessTokenError.TYPE.REQUEST_FORBIDDEN', | ||
RETRIES_EXCEEDED: 'z.auth.AccessTokenError.TYPE.RETRIES_EXCEEDED', | ||
}; | ||
} | ||
}; | ||
|
||
|
Oops, something went wrong.