I have such a .bat file
@echo off
set sql_bin_path=%MY_SQL%
cd /d %sql_bin_path%
mysqldump -u root -p --no-data test > test.sql
pause
goto :eof
:error
echo Something went wrong
pause
I need to catch a possible error in this line mysqldump -u root -p --no-data test > test.sql (for example if there isn't such db name) and move the execution to goto :error block
How to do it?