{"record":{"id":"192c974ba1122580","repo":"shadow1ng/fscan","slug":"kind-of-value-for-listener-is-not-func","errorCode":null,"errorMessage":"Kind of Value for listener is not Func.","messagePattern":"Kind of Value for listener is not Func\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/grdp/emission/emitter.go","lineNumber":19,"sourceCode":"// Package emission provides an event emitter.\n// copy form https://raw.githubusercontent.com/chuckpreslar/emission/master/emitter.go\n// fix issue with nest once\n\npackage emission\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"sync\"\n)\n\n// Default number of maximum listeners for an event.\nconst DefaultMaxListeners = 10\n\n// Error presented when an invalid argument is provided as a listener function\nvar ErrNoneFunction = errors.New(\"Kind of Value for listener is not Func.\")\n\n// RecoveryListener ...\ntype RecoveryListener func(interface{}, interface{}, error)\n\n// Emitter ...\ntype Emitter struct {\n\t// Mutex to prevent race conditions within the Emitter.\n\t*sync.Mutex\n\t// Map of event to a slice of listener function's reflect Values.\n\tevents map[interface{}][]reflect.Value\n\t// Optional RecoveryListener to call when a panic occurs.\n\trecoverer RecoveryListener\n\t// Maximum listeners for debugging potential memory leaks.\n\tmaxListeners int\n\n\t// Map of event to a slice of listener function's reflect Values.\n\tonces map[interface{}][]reflect.Value\n}","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/libs/grdp/emission/emitter.go#L1-L37","documentation":"ErrNoneFunction: emitted (or panicked, when no RecoveryListener is set) when a value registered via Emitter.On is not a reflect.Func — i.e. the caller passed something other than a function as the event listener.","triggerScenarios":"Thrown at libs/grdp/emission/emitter.go:19 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a function value to On()/Once(), not a method result or variable of another type","Register a RecoveryListener on the Emitter to convert the panic into recoverable handling","Add a compile-time check or test asserting listeners are funcs"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}