echo
echo copied to clipboard
router: return error when registering nil handler
Currently, router.insert only logs a warning when a nil handler is registered,
and continues processing. This can lead to runtime panics due to unnoticed misconfiguration.
This change makes router registration fail fast by returning an error when a nil handler is provided, so that misconfigurations can be detected earlier.