mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
Update/misc frontend (#2191)
* update version to 0.3.4 * update release guide with sdk instructions * remove comment * update page styling * closes #2152, closes #2155, closes #2157 * move marketing site link to description block * re-arrange setup wizard recovery options * move divider for update list item * fix bug in mocks to display lnd as aavailable for update --------- Co-authored-by: Matt Hill <matthewonthemoon@gmail.com>
This commit is contained in:
@@ -3,8 +3,6 @@ import { HttpErrorResponse } from '@angular/common/http'
|
||||
export class HttpError {
|
||||
readonly code = this.error.status
|
||||
readonly message = this.error.statusText
|
||||
readonly details = null
|
||||
readonly revision = null
|
||||
|
||||
constructor(private readonly error: HttpErrorResponse) {}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { IonicSafeString, ToastController } from '@ionic/angular'
|
||||
import { HttpError } from '../classes/http-error'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -9,7 +10,7 @@ export class ErrorToastService {
|
||||
|
||||
constructor(private readonly toastCtrl: ToastController) {}
|
||||
|
||||
async present(e: { message: string }, link?: string): Promise<void> {
|
||||
async present(e: HttpError | string, link?: string): Promise<void> {
|
||||
console.error(e)
|
||||
|
||||
if (this.toast) return
|
||||
@@ -42,12 +43,21 @@ export class ErrorToastService {
|
||||
}
|
||||
|
||||
export function getErrorMessage(
|
||||
{ message }: { message: string },
|
||||
e: HttpError | string,
|
||||
link?: string,
|
||||
): string | IonicSafeString {
|
||||
if (!message) {
|
||||
message = 'Unknown Error.'
|
||||
let message = ''
|
||||
|
||||
if (typeof e === 'string') {
|
||||
message = e
|
||||
} else if (e.code === 0) {
|
||||
message =
|
||||
'Request Error. Your browser blocked the request. This is usually caused by a corrupt browser cache or an overly aggressive ad blocker. Please clear your browser cache and/or adjust your ad blocker and try again'
|
||||
} else if (!e.message) {
|
||||
message = 'Unknown Error'
|
||||
link = 'https://docs.start9.com/latest/support/faq'
|
||||
} else {
|
||||
message = e.message
|
||||
}
|
||||
|
||||
if (link) {
|
||||
|
||||
Reference in New Issue
Block a user