// checks for any error on api
// returns nil if there is no error and result is provided
// maps error code to internal errors making handling errors easier
checks for any error on api
returns nil if there is no error and result is provided
maps error code to internal errors making handling errors easier
// checks for any error on api // returns nil if there is no error and result is provided // maps error code to internal errors making handling errors easier
func (l *IPLookup) GetAPIError() error {
	if l.ErrorCode == "" {
		return nil
	}
	switch l.ErrorCode {
	case "SERVER_ERROR":
		return ServerError
	case "EXPIRED_KEY":
		return ExpiredKey
	case "DAILY_LIMIT_REACHED":
		return DailyLimitReached
	case "MONTHLY_LIMIT_REACHED":
		return MonthlyLimitReached
	case "MAX_LIMIT_REACHED":
		return MaxLimitReached
	case "INVALID_KEY":
		return InvalidKey
	case "DEACTIVATED_KEY":
		return InactiveKey
	case "INVALID_IP":
		return InvalidIp
	case "NO_IP_PROVIDED":
		return NoIpProvided
	case "NO_API_KEY":
		return NoAPIKey
	default:
		return UnknownError
	}
}
func ( l * IPLookup ) GetAPIError ( ) error { if l . ErrorCode == " " { return nil } switch l . ErrorCode { case " " : return ServerError case " " : return ExpiredKey case " " : return DailyLimitReached case " " : return MonthlyLimitReached case " " : return MaxLimitReached case " " : return InvalidKey case " " : return InactiveKey case " " : return InvalidIp case " " : return NoIpProvided case " " : return NoAPIKey default : return UnknownError } }
checks for any error on api
returns nil if there is no error and result is provided
maps error code to internal errors making handling errors easier
checks for any error on api returns nil if there is no error and result is provided maps error code to internal errors making handling errors easier