Mercurial > servermonitor
diff ServerMonitor/Controls/HttpCheckControl.cs @ 1:9e92780ebc0f
Additional validation for SSH check
author | Brad Greco <brad@bgreco.net> |
---|---|
date | Tue, 01 Jan 2019 21:14:47 -0500 |
parents | 3e1a2131f897 |
children | 7127d5b5ac75 |
line wrap: on
line diff
--- a/ServerMonitor/Controls/HttpCheckControl.cs Mon Dec 31 18:32:14 2018 -0500 +++ b/ServerMonitor/Controls/HttpCheckControl.cs Tue Jan 01 21:14:47 2019 -0500 @@ -37,7 +37,14 @@ HttpCheck check = (HttpCheck)check1; check.Url = UrlTextBox.Text.Trim(); check.CheckResponseCode = ResponseCodeCheckBox.Checked; - check.ResponseCode = int.Parse(ResponseCodeTextBox.Text); + try + { + check.ResponseCode = int.Parse(ResponseCodeTextBox.Text); + } + catch + { + throw new UpdateCheckException("Response code must be an integer."); + } check.CheckResponseLength = ResponseLengthCheckbox.Checked; check.ResponseLengthMin = ResponseLengthMinTextBox.Text; check.ResponseLengthMax = ResponseLengthMaxTextBox.Text;