mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-25 08:42:20 +07:00
windows: error filter
This commit is contained in:
@@ -2,6 +2,7 @@ package xray
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"x-ui/logger"
|
||||
@@ -20,6 +21,12 @@ func (lw *LogWriter) Write(m []byte) (n int, err error) {
|
||||
|
||||
// Convert the data to a string
|
||||
message := strings.TrimSpace(string(m))
|
||||
msgLowerAll := strings.ToLower(message)
|
||||
|
||||
// Suppress noisy Windows process-kill signal that surfaces as exit status 1
|
||||
if runtime.GOOS == "windows" && strings.Contains(msgLowerAll, "exit status 1") {
|
||||
return len(m), nil
|
||||
}
|
||||
|
||||
// Check if the message contains a crash
|
||||
if crashRegex.MatchString(message) {
|
||||
|
||||
Reference in New Issue
Block a user