mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-17 12:42:16 +01:00
better op names + fixing issue with op chaining in errors
This commit is contained in:
@@ -28,7 +28,7 @@ func (p *chrome) Fullname() string {
|
||||
}
|
||||
|
||||
func (p *chrome) Start() error {
|
||||
const op = "chrome.Start"
|
||||
const op = "pm2.chrome.Start"
|
||||
if err := p.manager.start(p); err != nil {
|
||||
return &standarderror.Error{Op: op, Err: err}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ func (p *chrome) Start() error {
|
||||
}
|
||||
|
||||
func (p *chrome) Shutdown() error {
|
||||
const op = "chrome.Shutdown"
|
||||
const op = "pm2.chrome.Shutdown"
|
||||
if err := p.manager.shutdown(p); err != nil {
|
||||
return &standarderror.Error{Op: op, Err: err}
|
||||
}
|
||||
@@ -67,25 +67,25 @@ func (p *chrome) name() string {
|
||||
}
|
||||
|
||||
func (p *chrome) viable() bool {
|
||||
const debugOp = "chrome.viable"
|
||||
const op = "pm2.chrome.viable"
|
||||
// check if Google Chrome is correctly running.
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
p.manager.logger.DebugfOp(
|
||||
debugOp,
|
||||
op,
|
||||
"checking liveness via debug version endpoint http://localhost:9222/json/version",
|
||||
)
|
||||
v, err := devtool.New("http://localhost:9222").Version(ctx)
|
||||
if err != nil {
|
||||
p.manager.logger.DebugfOp(
|
||||
debugOp,
|
||||
op,
|
||||
"debug version endpoint returned error: %v",
|
||||
err,
|
||||
)
|
||||
return false
|
||||
}
|
||||
p.manager.logger.DebugfOp(
|
||||
debugOp,
|
||||
op,
|
||||
"debug version endpoint returned version info: %+v",
|
||||
*v,
|
||||
)
|
||||
@@ -93,7 +93,7 @@ func (p *chrome) viable() bool {
|
||||
}
|
||||
|
||||
func (p *chrome) warmup() {
|
||||
const debugOp = "chrome.warmup"
|
||||
const debugOp = "pm2.chrome.warmup"
|
||||
p.manager.logger.DebugfOp(
|
||||
debugOp,
|
||||
"allowing %v to startup",
|
||||
|
||||
@@ -22,7 +22,7 @@ func (p *unoconv) Fullname() string {
|
||||
}
|
||||
|
||||
func (p *unoconv) Start() error {
|
||||
const op = "unoconv.Start"
|
||||
const op = "pm2.unoconv.Start"
|
||||
if err := p.manager.start(p); err != nil {
|
||||
return &standarderror.Error{Op: op, Err: err}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ func (p *unoconv) Start() error {
|
||||
}
|
||||
|
||||
func (p *unoconv) Shutdown() error {
|
||||
const op = "unoconv.Shutdown"
|
||||
const op = "pm2.unoconv.Shutdown"
|
||||
if err := p.manager.shutdown(p); err != nil {
|
||||
return &standarderror.Error{Op: op, Err: err}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user