Refactor exception usage

This commit is contained in:
Jonas Lochmann
2020-09-28 02:00:00 +02:00
parent d68b425e0e
commit 8d65c5d777
148 changed files with 2061 additions and 769 deletions
+2 -2
View File
@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Conflict, Unauthorized } from 'http-errors'
import { Conflict, InternalServerError, Unauthorized } from 'http-errors'
import * as Sequelize from 'sequelize'
import { config } from '../../config'
import { Database } from '../../database'
@@ -147,7 +147,7 @@ export const setPrimaryDevice = async ({ database, websocket, deviceAuthToken, c
throw new Conflict()
}
} else {
throw new Error('illegal state')
throw new InternalServerError('illegal state')
}
// invalidiate user list