mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
enhance(wip): error handle
This commit is contained in:
parent
3f95ae5d90
commit
650196d06a
93 changed files with 5228 additions and 3738 deletions
|
@ -1,7 +1,6 @@
|
|||
package cert
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/0xJacky/Nginx-UI/internal/helper"
|
||||
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
||||
"os"
|
||||
|
@ -22,13 +21,11 @@ func (c *Content) WriteFile() (err error) {
|
|||
|
||||
nginxConfPath := nginx.GetConfPath()
|
||||
if !helper.IsUnderDirectory(c.SSLCertificatePath, nginxConfPath) {
|
||||
return fmt.Errorf("ssl_certificate_path: %s is not under the nginx conf path: %s",
|
||||
c.SSLCertificatePath, nginxConfPath)
|
||||
return e.NewWithParams(50006, ErrPathIsNotUnderTheNginxConfDir.Error(), c.SSLCertificatePath, nginxConfPath)
|
||||
}
|
||||
|
||||
if !helper.IsUnderDirectory(c.SSLCertificateKeyPath, nginxConfPath) {
|
||||
return fmt.Errorf("ssl_certificate_key_path: %s is not under the nginx conf path: %s",
|
||||
c.SSLCertificateKeyPath, nginxConfPath)
|
||||
return e.NewWithParams(50006, ErrPathIsNotUnderTheNginxConfDir.Error(), c.SSLCertificateKeyPath, nginxConfPath)
|
||||
}
|
||||
|
||||
// MkdirAll creates a directory named path, along with any necessary parents,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue