Describe the feature
When adding a path configuration through the API in which something is wrong, there is currently no automated way to get the error message back (except for parsing the logs).
For example, when username or password for an RTSP source are incorrect MediaMTX logs:
2025/10/20 16:32:20 ERR [path ***] [RTSP source] bad status code: 401 (Unauthorized)
It would be very nice if this error message could be passed through a hook (runOnError?) so it can make its way further into an automated system. The other option would be that error messages would be retrievable through the API somehow, though I feel that would be a more complicated thing to work with.