Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 33 lines (27 sloc) 0.676 kb
e8a1642 Rename simpledb -> SDB, aws/consts & sqs/consts
James D. Nurmi authored
1 package aws
2
cd1f203 Break out to external errors rather than per-service
James D. Nurmi authored
3 import (
d4aedff Gofmt the project for other devs.
James D. Nurmi authored
4 "os"
5 "http"
cd1f203 Break out to external errors rather than per-service
James D. Nurmi authored
6 )
7
e8a1642 Rename simpledb -> SDB, aws/consts & sqs/consts
James D. Nurmi authored
8 const (
d4aedff Gofmt the project for other devs.
James D. Nurmi authored
9 DEFAULT_SIGNATURE_VERSION = "2"
10 DEFAULT_SIGNATURE_METHOD = "HmacSHA256"
e8a1642 Rename simpledb -> SDB, aws/consts & sqs/consts
James D. Nurmi authored
11 )
12
13
cd1f203 Break out to external errors rather than per-service
James D. Nurmi authored
14 var ErrorNotFound os.Error = os.NewError("Not found")
15 var ErrorUnexpectedResponse os.Error = os.NewError("Unexpected response code")
16 var ErrorConflicts os.Error = os.NewError("Conflicts with another resources")
17 var ErrorForbidden os.Error = os.NewError("Access denied")
18
d4aedff Gofmt the project for other devs.
James D. Nurmi authored
19 func CodeToError(i int) (err os.Error) {
20 switch i {
21 case http.StatusOK:
22 case http.StatusNotFound:
23 err = ErrorNotFound
24 case http.StatusConflict:
25 err = ErrorConflicts
26 case http.StatusForbidden:
27 err = ErrorForbidden
28 default:
29 err = ErrorUnexpectedResponse
30 }
31 return
cd1f203 Break out to external errors rather than per-service
James D. Nurmi authored
32 }
Something went wrong with that request. Please try again.