Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: How to handle errors


Member

Status: Offline
Posts: 20
Date: Jul 14, 2009
How to handle errors
Permalink   
 


Hi,str =

"https://secure.ifbyphone.com/click_to_xyz.php?app=cts&acct=XXX&scheduleonly&survo_id=ccc&key=dfgdg&type=2&sdate=" & StartDate & "&edate=" & EndDate & "&tz=Pacific&phone=" & csvfile & "&attempts=3&desc=Mydfgdfg" 

 

Dim hRequest As HttpWebRequest = WebRequest.Create(str)

 

Try

 

Dim resp As HttpWebResponse = hRequest.GetResponse() 

Dim sr AsNew StreamReader(resp.GetResponseStream()) 

Dim results AsString = sr.ReadToEnd()sr.Close()lblCallStatus.Visible =

True

lblCallStatus.Text = results

 

Catch ex As WebExceptionResponse.Write(

"<font color=red>Error<br />Status: " & ex.Status & "Message: " & ex.Message & "</font>") 

EndTry

in the above code i want to handle if there is any error dure csv file does not have write format or any erros records not found in .csv file etcc.
How to handle this.



__________________


Veteran Member

Status: Offline
Posts: 45
Date: Jul 14, 2009
Permalink   
 

We will pass back one of the following depending on the situation:

- Specified Broadcast CSV file extension must only be "csv"
- Invalid Broadcast phone number(s) specified
- Specified Broadcast CSV file is improperly formatted:  missing 'number' column


__________________
-Phil Seguin
pseguin@ifbyphone.com


Member

Status: Offline
Posts: 20
Date: Jul 14, 2009
Permalink   
 

Thanks for your reply.
1. IF .csv file has 5 numbers to schedule, out of 5 numbers 2 numbers are incorrot format. How to handle this.
2. What message do you return if there are no errors returned.
3. Also is it good idea to check only sucess message and in else part handle logic for error prcoessing. do you reccomond this.
ex:
   if  check "results" variable for sucess
      else
           // logic for handling errors etcc








__________________


Veteran Member

Status: Offline
Posts: 45
Date: Jul 14, 2009
Permalink   
 

1) We will automatically scrub out most bad numbers from your CSV file. You will not receive any immediate response when numbers are scrubbed. We simply will not attempt to call that user.

2) We return back "X Voice Broadcast(s) scheduled. Broadcast ID: XX" Where X is the number of calls we will be calling and XX is the broadcast ID associated with the broadcast.

3) Yes I would recommend to check for the success message. If you dont receive the success message, assume the broadcast has not been scheduled.

__________________
-Phil Seguin
pseguin@ifbyphone.com


Member

Status: Offline
Posts: 20
Date: Jul 14, 2009
Permalink   
 

"1) We will automatically scrub out most bad numbers from your CSV file. You will not receive any immediate response when numbers are scrubbed. We simply will not attempt to call that user."

in .csv file, 2 out of 5 numbers are not in correct format.
as per my understanding from you reply above case(2 out of 5 numbers are not in correct format), i still receive sucess message saying "5 Voice Broadcast(s) scheduled. Broadcast ID: XX".

actaully, 3 broadcasts only schduled right. Do you log anywhere 2 incrrect format numbers. Please help, 



__________________


Veteran Member

Status: Offline
Posts: 45
Date: Jul 14, 2009
Permalink   
 

Currently there is no log you can access by the API to give you the incorrect format numbers. We will show you in the broadcast report which calls did go through however.

__________________
-Phil Seguin
pseguin@ifbyphone.com


Member

Status: Offline
Posts: 20
Date: Jul 14, 2009
Permalink   
 

Thanks a lot for the help!.
 One last question, How to check the sucess message as  success message is "X Voice Broadcast(s) scheduled. Broadcast ID: XX". here "X, XX" will change evry time.
if i want to compare ,

if result = '"X Voice Broadcast(s) scheduled. Broadcast ID: XX". " like this.
{
  // sucess logic
}

how can i make above condition equal. so that control goes to success logic.
Please help.



__________________


Veteran Member

Status: Offline
Posts: 45
Date: Jul 14, 2009
Permalink   
 

I am not sure I understand your question. If you are checking if any error, then you can check if string contains 'Voice Broadcast(s) scheduled' . If you see that, then there was no error in scheduling the broadcast.

Hope this helps


__________________
-Phil Seguin
pseguin@ifbyphone.com


Member

Status: Offline
Posts: 20
Date: Jul 14, 2009
Permalink   
 

Thanks a lot. i got it. Just i wanted to check if any errors.


__________________
Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.

Post to Digg Post to Del.icio.us


Create your own FREE Forum
Report Abuse
Powered by ActiveBoard