MCPcopy Create free account
hub / github.com/kataras/iris / newProductProblem

Function newProductProblem

_examples/routing/http-errors/main.go:45–59  ·  view source on GitHub ↗
(productName, detail string)

Source from the content-addressed store, hash-verified

43}
44
45func newProductProblem(productName, detail string) iris.Problem {
46 return iris.NewProblem().
47 // The type URI, if relative it automatically convert to absolute.
48 Type("/product-error").
49 // The title, if empty then it gets it from the status code.
50 Title("Product validation problem").
51 // Any optional details.
52 Detail(detail).
53 // The status error code, required.
54 Status(iris.StatusBadRequest).
55 // Any custom key-value pair.
56 Key("productName", productName)
57 // Optional cause of the problem, chain of Problems.
58 // Cause(iris.NewProblem().Type("/error").Title("cause of the problem").Status(400))
59}
60
61func problemExample(ctx iris.Context) {
62 /*

Callers 1

problemExampleFunction · 0.85

Calls 5

KeyMethod · 0.80
StatusMethod · 0.80
DetailMethod · 0.80
TitleMethod · 0.80
TypeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…