// NotFound set a handler which is called when no matching route is found
165873
func (app *App) NotFound(notFoundHandler func(*Context)) *App {
	app.defaultRouter.NotFound(notFoundHandler)
	return app
}
1023656
func (m *Mux) HandleNotFound(rw http.ResponseWriter, req *http.Request) {
	if m.notFound != nil {
		m.notFound.ServeHTTP(rw, req)
	} else {
		http.NotFound(rw, req)
	}
}
1328468
func (r Resource) NotFound(request *restful.Request, response *restful.Response) {
	ErrorResponseHandler(request, response, nil, NewErrorResponse(
		http.StatusNotFound,
		"This "+r.TypeName+" does not exist.",
		r.TypeName))
}
1033151
func (s *BatchGetRepositoriesOutput) SetRepositoriesNotFound(v []*string) *BatchGetRepositoriesOutput {
	s.RepositoriesNotFound = v
	return s
}
773565
func (r *Router) NotFound(fn interface{}) *Router {
	if r.parent != nil {
		panic("You can only set a NotFoundHandler on the root router.")
	}
	vfn := reflect.ValueOf(fn)
	validateNotFoundHandler(vfn, r.contextType)
	r.notFoundHandler = vfn
	return r
}
1209021
func notFoundHandler(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	pe := &platform.Error{
		Code: platform.ENotFound,
		Msg:  "path not found",
	}

	EncodeError(ctx, pe, w)
}
1160918
func NotFound(detail string, a ...interface{}) *ProblemDetails {
	return &ProblemDetails{
		Type:       MalformedProblem,
		Detail:     fmt.Sprintf(detail, a...),
		HTTPStatus: http.StatusNotFound,
	}
}
947843
func (s *BatchGetDevEndpointsOutput) SetDevEndpointsNotFound(v []*string) *BatchGetDevEndpointsOutput {
	s.DevEndpointsNotFound = v
	return s
}
1122252
func (s *BatchGetBuildsOutput) SetBuildsNotFound(v []*string) *BatchGetBuildsOutput {
	s.BuildsNotFound = v
	return s
}
1100272
func IsNotFound(err error) bool {
	kerr, ok := err.(*KeyError)
	return ok && kerr.Err == errNotFound
}
1209073
func IsNotFound(err error) bool {
	_, ok := getImplementer(err).(ErrNotFound)
	return ok
}
1348815
func (builder *FetchSetCommandBuilder) WithNotFoundOk(notFoundOk bool) *FetchSetCommandBuilder {
	builder.protobuf.NotfoundOk = &notFoundOk
	return builder
}
906713
func (r *Route) NotFoundFunc(f http.HandlerFunc) *Route {
	return r.NotFound(http.HandlerFunc(f))
}
831166
func (builder *FetchCounterCommandBuilder) WithNotFoundOk(notFoundOk bool) *FetchCounterCommandBuilder {
	builder.protobuf.NotfoundOk = &notFoundOk
	return builder
}
362813
func commandNotFound(ctx *cli.Context, command string) {
	msg := fmt.Sprintf("`%s` is not a mc command. See `mc --help`.", command)
	closestCommands := findClosestCommands(command)
	if len(closestCommands) > 0 {
		msg += fmt.Sprintf("\n\nDid you mean one of these?\n")
		if len(closestCommands) == 1 {
			cmd := closestCommands[0]
			msg += fmt.Sprintf("        `%s`", cmd)
		} else {
			for _, cmd := range closestCommands {
				msg += fmt.Sprintf("        `%s`\n", cmd)
			}
		}
	}
	fatalIf(errDummy().Trace(), msg)
}
1344748
func (router *Router) FindHandler(req *http.Request) (http.HandlerFunc, bool) {

	// Ask child first
	for _, child := range router.subrouters {
		handler, ok := child.FindHandler(req)
		if ok && handler != nil {
			return func(w http.ResponseWriter, req *http.Request) {
				child.handleFilteredFunc(handler, w, req)
			}, ok
		}
	}

	// Ask subroute
	if handlers, ok := router.routes[MethodAny]; ok {
		for key, handler := range handlers {
			if strings.HasPrefix(req.URL.Path, key) {
				// Match!!
				rest := strings.Replace(req.URL.Path, key, "", -1)
				if !strings.HasPrefix(rest, "/") {
					rest = "/" + rest
				}
				return handler, true
			}
		}
	}

	// Ask normal routes
	if handlers, ok := router.routes[HTTPMethod(req.Method)]; ok {
		if handler, ok := handlers[req.URL.Path]; ok {
			return handler, true
		}
	}

	// Ask regex routes
	if handlers, ok := router.regexps[HTTPMethod(req.Method)]; ok {
		for exp, handler := range handlers {
			if exp.MatchString(req.URL.Path) {
				matched := exp.FindAllStringSubmatch(req.URL.Path, -1)
				if req.Form == nil {
					req.Form = url.Values{}
				}
				for i, name := range exp.SubexpNames() {
					req.Form.Add(name, matched[0][i])
				}
				return handler, true
			}
		}
	}
	return nil, false
}
923303
func (s *DB) RecordNotFound() bool {
	for _, err := range s.GetErrors() {
		if err == ErrRecordNotFound {
			return true
		}
	}
	return false
}