Skip to content

Commit

Permalink
Parse errors (passed as integers from server) into strings
Browse files Browse the repository at this point in the history
  • Loading branch information
sanko committed Jun 4, 2011
1 parent df711ac commit 2d63ea4
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions lib/AnyEvent/MSN/Protocol.pm
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,82 @@ package AnyEvent::MSN::Protocol 0.001;
}
sub err2str { # Converts \d+ to \s+
my ($i, @data) = @_;
state $errors //= {200 => 'Invalid Syntax',
201 => 'Invalid parameter',
205 => 'Invalid user',
206 => 'Domain name missing',
207 => 'Already logged in',
208 => 'Invalid User Name',
209 => 'Invlaid Friendly Name',
210 => 'List Full',
213 => 'Invalid Rename Request?',
215 => 'User already on list',
216 => 'User not on list',
217 => 'User not online',
218 => 'Already in that mode',
219 => 'User is in the opposite list',
223 => 'Too Many Groups',
224 => 'Invalid Groups ',
225 => 'User Not In Group',
227 => 'Group Is Not Empty',
228 => 'Group With Same Name Exists',
229 => 'Group Name too long',
230 => 'Cannont Remove Group Zero',
231 => 'Invalid Group',
240 => 'Empty Domain',
280 => 'Switchboard Failed',
281 => 'Transfer to Switchboard failed',
282 => 'P2P Error?',
300 => 'Required Field Missing',
301 => 'Too Many Hits to FND',
302 => 'Not Logged In',
402 => 'Error Accessing Contact List',
403 => 'Error Accessing Contact List',
420 => 'Invalid Account Permissions',
500 => 'Internal Server Error',
501 => 'Database Server Error',
502 => 'Command Disabled',
510 => 'File Operation Failed',
511 => 'User is Banned',
520 => 'Memory Allocation Failed',
540 => 'Challenge Response Failed',
600 => 'Server Is Busy',
601 => 'Server Is Unavailable',
602 => 'Peer Name Server is Down',
603 => 'Database Connection Failed',
604 => 'Server Going Down',
605 => 'Server Unavailable',
707 => 'Could Not Create Connection',
710 => 'Bad CVR Parameter Sent',
711 => 'Write is Blocking',
712 => 'Session is Overloaded',
713 => 'Too Many Active Users',
714 => 'Too Many Sessions',
715 => 'Command Not Expected',
717 => 'Bad Friend File',
731 => 'Badly Formated CVR',
800 => 'Changing Display Name Too Rapidly',
910 => 'Server Too Busy',
911 => 'Authentication Failed',
912 => 'Server Too Busy',
913 => 'Not allowed While Offline',
914 => 'Server Not Available',
915 => 'Server Not Available',
916 => 'Server Not Available',
917 => 'Authentication Failed',
918 => 'Server Too Busy',
919 => 'Server Too Busy',
920 => 'Not Accepting New Users',
921 => 'Server Too Busy: User Digest',
922 => 'Server Too Busy',
923 => 'Kids Passport Without Parental Consent',
924 => 'Passport Account Not Verified',
928 => 'Bad ticket',
931 => 'Account Not On This Server'
};
$errors->{$i} // 'Unknown error #' . $i;
}
}
1;
Expand Down

0 comments on commit 2d63ea4

Please sign in to comment.