I found that as a solution
trap 'on_error $LINENO' ERR ## not "" because it will pass the line number of the trap