mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-19 08:50:46 +00:00
Return error code if server fails to start
This commit is contained in:
@@ -25,6 +25,7 @@ const (
|
||||
ResponseFailedToParseRequest = 103
|
||||
ResponseServerInstanceAlreadyExists = 104
|
||||
ResponseServerInstanceNotFound = 105
|
||||
ResponseFailedToStartServer = 106
|
||||
|
||||
ResponseRepositoryNotFound = 200
|
||||
ResponseRepositoryConflict = 201
|
||||
|
||||
@@ -37,7 +37,10 @@ func CreateServerInstance(serverName *C.char, configurationJSON *C.char) int {
|
||||
})
|
||||
|
||||
server := api.NewApiServer(repository, configuration)
|
||||
server.Start()
|
||||
err = server.Start()
|
||||
if err != nil {
|
||||
return ResponseFailedToStartServer
|
||||
}
|
||||
|
||||
addInstance(serverNameStr, &ServerInstance{
|
||||
server: server,
|
||||
|
||||
Reference in New Issue
Block a user