Pull `<p class='error'>` and `</p`> out of switch. Consider using a dictionary:

    $errors = [
        'could_not_resolve' => 'Your bot hostname is invalid. Did you enter a valid hostname?',
        ...
    ];
    echo $errors[ $error ];