fix: do not error if proxy is not running
This commit is contained in:
parent
684b8e0914
commit
8ae61c8f78
3 changed files with 13 additions and 3 deletions
|
|
@ -112,9 +112,15 @@ export async function haproxyInstance() {
|
|||
}
|
||||
|
||||
export async function configureHAProxy() {
|
||||
const haproxy = await haproxyInstance();
|
||||
|
||||
try {
|
||||
const haproxy = await haproxyInstance();
|
||||
await checkHAProxy(haproxy);
|
||||
} catch (error) {
|
||||
return 'Error: HAProxy is not running';
|
||||
}
|
||||
|
||||
try {
|
||||
const data = {
|
||||
applications: [],
|
||||
services: [],
|
||||
|
|
|
|||
|
|
@ -49,7 +49,12 @@ export async function completeTransaction(transactionId) {
|
|||
}
|
||||
export async function deleteProxy({ id }) {
|
||||
const haproxy = await haproxyInstance();
|
||||
await checkHAProxy(haproxy);
|
||||
try {
|
||||
await checkHAProxy(haproxy);
|
||||
} catch (error) {
|
||||
return 'Error: HAProxy is not running';
|
||||
}
|
||||
|
||||
let transactionId;
|
||||
try {
|
||||
await haproxy.get(`v2/services/haproxy/configuration/backends/${id}`).json();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { dev } from '$app/env';
|
||||
import { ErrorHandler } from '$lib/database';
|
||||
import { configureHAProxy } from '$lib/haproxy/configuration';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue