func (e *APIError) String() string {
	if e.Code == 0 {
		return e.Detail
	}
	s := fmt.Sprintf("API error %d", e.Code)
	if m, ok := errorCodeMaps[e.Service]; ok {
		s += " (" + e.Service + ": " + m[e.Code] + ")"
	}
	if e.Detail != "" {
		s += ": " + e.Detail
	}
	return s
}
AG: Leaving as it is; Need Error() instead to use APIError as Error
package appengine_internal
import (
	"flag"
	"fmt"
	"http"
	"io"
	"log"
	"strings"
)
var (
	addrHTTP = flag.String("addr_http", "", "net:laddr to listen on for HTTP requests.")
	addrAPI  = flag.String("addr_api", "", "net:raddr to dial for API requests.")
)
type ServeHTTPFunc func(netw, addr string)
var serveHTTPFunc ServeHTTPFunc
func RegisterHTTPFunc(f ServeHTTPFunc) {
	serveHTTPFunc = f
}
type CallOptions struct {
	Deadline float64  
}
var errorCodeMaps = make(map[string]map[int32]string)
func RegisterErrorCodeMap(service string, m map[int32]string) {
	errorCodeMaps[service] = m
}
type APIError struct {
	Service string
	Detail  string
	Code    int32  
}