mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
Merge pull request #1280 from hydralauncher/fix/headers-and-logs
Fix/headers and logs
This commit is contained in:
commit
6a673f0c6b
@ -174,8 +174,10 @@ export class PythonInstance {
|
|||||||
.then((response) => response.data);
|
.then((response) => response.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async handleRpcError(_error: unknown) {
|
private static async handleRpcError(error: unknown) {
|
||||||
await this.rpc.get("/healthcheck").catch(() => {
|
logger.error(error);
|
||||||
|
|
||||||
|
return this.rpc.get("/healthcheck").catch(() => {
|
||||||
logger.error(
|
logger.error(
|
||||||
"RPC healthcheck failed. Killing process and starting again"
|
"RPC healthcheck failed. Killing process and starting again"
|
||||||
);
|
);
|
||||||
|
@ -153,21 +153,26 @@ export class HydraApi {
|
|||||||
(error) => {
|
(error) => {
|
||||||
logger.error(" ---- RESPONSE ERROR -----");
|
logger.error(" ---- RESPONSE ERROR -----");
|
||||||
const { config } = error;
|
const { config } = error;
|
||||||
|
const data = JSON.parse(config.data);
|
||||||
|
|
||||||
logger.error(
|
logger.error(
|
||||||
config.method,
|
config.method,
|
||||||
config.baseURL,
|
config.baseURL,
|
||||||
config.url,
|
config.url,
|
||||||
config.headers,
|
omit(config.headers, ["accessToken", "refreshToken"]),
|
||||||
config.data
|
Array.isArray(data)
|
||||||
|
? data
|
||||||
|
: omit(data, ["accessToken", "refreshToken"])
|
||||||
);
|
);
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
logger.error(
|
logger.error(
|
||||||
"Response",
|
"Response error:",
|
||||||
error.response.status,
|
error.response.status,
|
||||||
error.response.data
|
error.response.data
|
||||||
);
|
);
|
||||||
} else if (error.request) {
|
} else if (error.request) {
|
||||||
logger.error("Request", error.request);
|
const errorData = error.toJSON();
|
||||||
|
logger.error("Request error:", errorData.message);
|
||||||
} else {
|
} else {
|
||||||
logger.error("Error", error.message);
|
logger.error("Error", error.message);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ export const getUserData = () => {
|
|||||||
if (err instanceof UserNotLoggedInError) {
|
if (err instanceof UserNotLoggedInError) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
logger.error("Failed to get logged user", err);
|
logger.error("Failed to get logged user");
|
||||||
const loggedUser = await userAuthRepository.findOne({
|
const loggedUser = await userAuthRepository.findOne({
|
||||||
where: { id: 1 },
|
where: { id: 1 },
|
||||||
relations: { subscription: true },
|
relations: { subscription: true },
|
||||||
|
@ -85,7 +85,11 @@ export class WindowManager {
|
|||||||
return callback(details);
|
return callback(details);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (details.url.includes("intercom.io")) {
|
if (details.url.includes("featurebase")) {
|
||||||
|
return callback(details);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (details.url.includes("chatwoot")) {
|
||||||
return callback(details);
|
return callback(details);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user