Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(697)

Side by Side Diff: state/apiserver/testing/errors.go

Issue 85380043: state;api: Allow adding existing networks/NICs (Closed)
Patch Set: Created 9 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « state/apiserver/provisioner/provisioner_test.go ('k') | state/machine.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 Canonical Ltd. 1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package testing 4 package testing
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 8
9 "launchpad.net/juju-core/state/api/params" 9 "launchpad.net/juju-core/state/api/params"
10 ) 10 )
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 } 29 }
30 30
31 func NotAssignedError(unitName string) *params.Error { 31 func NotAssignedError(unitName string) *params.Error {
32 return &params.Error{ 32 return &params.Error{
33 Message: fmt.Sprintf("unit %q is not assigned to a machine", uni tName), 33 Message: fmt.Sprintf("unit %q is not assigned to a machine", uni tName),
34 Code: params.CodeNotAssigned, 34 Code: params.CodeNotAssigned,
35 } 35 }
36 } 36 }
37 37
38 func AlreadyExistsError(what string) *params.Error {
39 return &params.Error{
40 Message: fmt.Sprintf("%s already exists", what),
41 Code: params.CodeAlreadyExists,
42 }
43 }
44
38 func ServerError(message string) *params.Error { 45 func ServerError(message string) *params.Error {
39 return &params.Error{ 46 return &params.Error{
40 Message: message, 47 Message: message,
41 Code: "", 48 Code: "",
42 } 49 }
43 } 50 }
44 51
45 func PrefixedError(prefix, message string) *params.Error { 52 func PrefixedError(prefix, message string) *params.Error {
46 return ServerError(prefix + message) 53 return ServerError(prefix + message)
47 } 54 }
OLDNEW
« no previous file with comments | « state/apiserver/provisioner/provisioner_test.go ('k') | state/machine.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b