MCPcopy Index your code
hub / github.com/devspace-sh/devspace / exitWithError

Function exitWithError

helper/ssh/server.go:256–270  ·  view source on GitHub ↗
(s ssh.Session, err error)

Source from the content-addressed store, hash-verified

254}
255
256func exitWithError(s ssh.Session, err error) {
257 if err != nil {
258 stderrlog.Errorf("%v", err)
259 msg := strings.TrimPrefix(err.Error(), "exec: ")
260 if _, err := s.Stderr().Write([]byte(msg)); err != nil {
261 stderrlog.Errorf("failed to write error to session: %v", err)
262 }
263 }
264
265 // always exit session
266 err = s.Exit(ExitCode(err))
267 if err != nil {
268 stderrlog.Errorf("session failed to exit: %v", err)
269 }
270}
271
272func SftpHandler(sess ssh.Session) {
273 debugStream := io.Discard

Callers 1

handlerMethod · 0.85

Calls 4

ErrorfFunction · 0.92
ExitCodeFunction · 0.85
ErrorMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected