86219e781b
This checkin continues progress on marapongo/mu#9. It's still not complete, however we're getting there. In particular, this includes: * Rename of ComplexLiteral to SchemaLiteral, as it is used exclusively for schematized types. Also includes a set of changes associated with this, like deep value conversion to `map[string]interface{}`. * Binding of schema types included within a Stack. This allows names in type references to be bound to those schema types during typechecking. This also includes binding schema properties, reusing all the existing property binding logic for stacks. In this way, properties between stacks and custom schema types are one and the same, which is nice. * Enforcement for custom schema constraints; this includes Pattern, MaxLength, MinLength, Maximum, and Minimum, as per the JSON Schema specification.
104 lines
2.7 KiB
Go
104 lines
2.7 KiB
Go
// Copyright 2016 Marapongo, Inc. All rights reserved.
|
|
|
|
package errors
|
|
|
|
import (
|
|
"github.com/marapongo/mu/pkg/ast"
|
|
"github.com/marapongo/mu/pkg/diag"
|
|
)
|
|
|
|
var ErrorMissingStackName = &diag.Diag{
|
|
ID: 500,
|
|
Message: "This Stack is missing a `name` property (or it is empty)",
|
|
}
|
|
|
|
var ErrorIllegalStackVersion = &diag.Diag{
|
|
ID: 501,
|
|
Message: "This Stack's version '%v' is invalid: %v",
|
|
}
|
|
|
|
var ErrorSymbolAlreadyExists = &diag.Diag{
|
|
ID: 502,
|
|
Message: "A symbol already exists with the name '%v'",
|
|
}
|
|
|
|
var ErrorStackTypeNotFound = &diag.Diag{
|
|
ID: 503,
|
|
Message: "Stack type '%v' was not found; has it been installed?",
|
|
}
|
|
|
|
var ErrorNonAbstractStacksMustDefineServices = &diag.Diag{
|
|
ID: 504,
|
|
Message: "Non-abstract stacks must declare at least one private or public service",
|
|
}
|
|
|
|
var ErrorCannotCreateAbstractStack = &diag.Diag{
|
|
ID: 505,
|
|
Message: "Service '%v' cannot create abstract stack '%v'; only concrete stacks may be created",
|
|
}
|
|
|
|
var ErrorMissingRequiredProperty = &diag.Diag{
|
|
ID: 506,
|
|
Message: "Missing required property '%v'",
|
|
}
|
|
|
|
var ErrorUnrecognizedProperty = &diag.Diag{
|
|
ID: 507,
|
|
Message: "Unrecognized property '%v'",
|
|
}
|
|
|
|
var ErrorIncorrectType = &diag.Diag{
|
|
ID: 508,
|
|
Message: "Incorrect type; expected '%v', got '%v'",
|
|
}
|
|
|
|
var ErrorServiceNotFound = &diag.Diag{
|
|
ID: 509,
|
|
Message: "A service named '%v' was not found",
|
|
}
|
|
|
|
var ErrorServiceHasNoPublics = &diag.Diag{
|
|
ID: 510,
|
|
Message: "The service '%v' of type '%v' has no public entrypoint; it cannot be referenced",
|
|
}
|
|
|
|
var ErrorServiceHasManyPublics = &diag.Diag{
|
|
ID: 511,
|
|
Message: "The service '%v' of type '%v' has multiple public entrypoints; please choose one using a selector",
|
|
}
|
|
|
|
var ErrorServiceSelectorNotFound = &diag.Diag{
|
|
ID: 512,
|
|
Message: "No public by the given selector '%v' was found in service '%v' of type '%v'",
|
|
}
|
|
|
|
var ErrorServiceSelectorIsPrivate = &diag.Diag{
|
|
ID: 513,
|
|
Message: "The given selector '%v' references a private service in '%v' of type '%v'; it must be public",
|
|
}
|
|
|
|
var ErrorNotAName = &diag.Diag{
|
|
ID: 514,
|
|
Message: "The string '%v' is not a valid name (expected: " + ast.NamePartRegexps + ")",
|
|
}
|
|
|
|
var ErrorStackTypeExpected = &diag.Diag{
|
|
ID: 515,
|
|
Message: "A stack type was expected here; '%v' did not resolve to a stack ('%v')",
|
|
}
|
|
|
|
var ErrorSchemaTypeExpected = &diag.Diag{
|
|
ID: 516,
|
|
Message: "A schema type was expected here; '%v' did not resolve to a schema ('%v')",
|
|
}
|
|
|
|
var ErrorSchemaConstraintUnmet = &diag.Diag{
|
|
ID: 517,
|
|
Message: "Schema constraint %v unmet; expected %v, got %v",
|
|
}
|
|
|
|
var ErrorSchemaConstraintType = &diag.Diag{
|
|
ID: 517,
|
|
Message: "Unexpected type conflict with constraint %v; expected %v, got %v",
|
|
}
|