Back to project page ReadabilitySDK.
The source code is released under:
MIT License
If you think the Android project ReadabilitySDK listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.idemidov.readability.util; /*w w w .ja v a2s.co m*/ import com.idemidov.readability.exception.AuthorizationException; import com.idemidov.readability.exception.BadRequestException; import com.idemidov.readability.exception.ForbiddenException; import com.idemidov.readability.exception.InternalErrorException; import com.idemidov.readability.exception.NotFoundException; public class ErrorHandler { public static void handleHttpCode(int code) throws AuthorizationException, NotFoundException, InternalErrorException, BadRequestException, ForbiddenException { switch (code) { case 401: throw new AuthorizationException(); case 404: throw new NotFoundException(); case 500: throw new InternalErrorException(); case 400: throw new BadRequestException(); case 403: throw new ForbiddenException(); } } }