Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Show error log if web server fails (#400)

Kilian Lieret1fa4e2a3e1d0
diff --git a/start_web_ui.sh b/start_web_ui.sh
index 99904ec8..1350dac3 100755
--- a/start_web_ui.sh
+++ b/start_web_ui.sh
@@ -5,9 +5,17 @@ set -euo pipefail
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
function stop_react {
+ echo "Stopping react server"
npx --prefix "${this_dir}/sweagent/frontend" pm2 delete swe-agent
}
+function print_log {
+ echo "Something went wrong. Here's web_api.log:"
+ echo "----------"
+ cat web_api.log
+ echo "----------"
+}
+
cd "${this_dir}/sweagent/frontend"
npm install
trap stop_react exit
@@ -24,4 +32,5 @@ echo "* Something went wrong? Please check "
echo " web_api.log for error messages!"
cd ../../
+trap print_log ERR
python sweagent/api/server.py > web_api.log 2>&1