Add error to GetSession return values
- Add button to copy instance SSH access
This commit is contained in:
@@ -7,17 +7,21 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/play-with-docker/play-with-docker/storage"
|
||||
)
|
||||
|
||||
func Home(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
sessionId := vars["sessionId"]
|
||||
|
||||
s := core.SessionGet(sessionId)
|
||||
if s == nil {
|
||||
s, err := core.SessionGet(sessionId)
|
||||
if err == storage.NotFoundError {
|
||||
// Session doesn't exist (can happen if closing the sessions an reloading the page, or similar).
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
} else if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
if s.Stack != "" {
|
||||
go core.SessionDeployStack(s)
|
||||
|
||||
Reference in New Issue
Block a user