mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
lot of changes
This commit is contained in:
@@ -13,6 +13,44 @@ export class HttpErrorHandle {
|
||||
) { }
|
||||
|
||||
async httpStatusHandle(error) {
|
||||
switch (error.status
|
||||
) {
|
||||
case 0:
|
||||
const result = await this.backgroundService.offline()
|
||||
if(result) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case 400:
|
||||
this.toastService._badRequest('Lamentamos, mas houve um problema com sua solicitação. Por favor, tente novamente')
|
||||
break;
|
||||
case 401:
|
||||
this.toastService._badRequest('Lamento, parece que não tem acesso a essas informações. Entre em contacto com o administrador.');
|
||||
break;
|
||||
case 403:
|
||||
this.toastService._badRequest('Lamentamos, você não tem permissão para acessar este serviço.')
|
||||
break;
|
||||
case 404:
|
||||
this.toastService._badRequest('Lamentamos, não encontramos o que procura.')
|
||||
break;
|
||||
case 500:
|
||||
this.toastService._badRequest('Lamentamos, mas houve um erro interno do servidor. Por favor, tente novamente mais tarde.')
|
||||
break;
|
||||
case 502:
|
||||
this.toastService._badRequest('Lamentamos, houve um problema com o servidor. Por favor, tente novamente mais tarde.')
|
||||
break;
|
||||
case 503:
|
||||
this.toastService._badRequest('Lamentamos, o serviço está indisponível no momento. Por favor, tente novamente mais tarde.')
|
||||
break
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
async loginHttpStatusHandle(error) {
|
||||
switch (error.status
|
||||
) {
|
||||
case 0:
|
||||
@@ -50,6 +88,18 @@ export class HttpErrorHandle {
|
||||
}
|
||||
}
|
||||
|
||||
validationMessagge(service: string, callback?: any) {
|
||||
switch (service) {
|
||||
case 'diplomaAsDraft':
|
||||
this.toastService._badRequest('Este diploma não contem um draft para ser assinado!')
|
||||
break;
|
||||
|
||||
default:
|
||||
this.toastService._badRequest('')
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
httpsSucessMessagge(service: string, callback?: any) {
|
||||
switch (service) {
|
||||
case 'new event':
|
||||
|
||||
Reference in New Issue
Block a user