Feature better 404s (#416)
* feature: CSS on actions * feature: Less crashes when things are not found
This commit is contained in:
parent
c0a18f82a5
commit
1d9502d800
|
|
@ -7,6 +7,8 @@ import (
|
|||
log "github.com/sirupsen/logrus"
|
||||
"google.golang.org/genproto/googleapis/api/httpbody"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
||||
"errors"
|
||||
"net"
|
||||
|
|
@ -70,7 +72,7 @@ func (api *oliveTinAPI) StartAction(ctx ctx.Context, req *pb.StartActionRequest)
|
|||
api.executor.MapActionIdToBindingLock.RUnlock()
|
||||
|
||||
if pair == nil || pair.Action == nil {
|
||||
return nil, errors.New("Action not found")
|
||||
return nil, status.Errorf(codes.NotFound, "Action not found.")
|
||||
}
|
||||
|
||||
execReq := executor.ExecutionRequest{
|
||||
|
|
@ -153,7 +155,7 @@ func (api *oliveTinAPI) StartActionByGetAndWait(ctx ctx.Context, req *pb.StartAc
|
|||
LogEntry: internalLogEntryToPb(internalLogEntry),
|
||||
}, nil
|
||||
} else {
|
||||
return nil, errors.New("Execution not found!")
|
||||
return nil, status.Errorf(codes.NotFound, "Execution not found.")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -211,7 +213,11 @@ func (api *oliveTinAPI) ExecutionStatus(ctx ctx.Context, req *pb.ExecutionStatus
|
|||
ile = getMostRecentExecutionStatusById(api, req.ActionId)
|
||||
}
|
||||
|
||||
res.LogEntry = internalLogEntryToPb(ile)
|
||||
if ile == nil {
|
||||
return nil, status.Errorf(codes.NotFound, "Execution not found.")
|
||||
} else {
|
||||
res.LogEntry = internalLogEntryToPb(ile)
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -328,6 +328,10 @@ function marshalLink (item, fieldset) {
|
|||
btn.classList.add('error')
|
||||
}
|
||||
|
||||
if (item.cssClass !== '') {
|
||||
btn.classList.add(item.cssClass)
|
||||
}
|
||||
|
||||
fieldset.appendChild(btn)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue