FileHandleWriter: Add error handling to stagedir creation
This commit is contained in:
Родитель
c184f41f10
Коммит
3640223220
|
@ -35,7 +35,10 @@ func NewFileHandleWriter(handle *FileHandle, newFile bool) (*FileHandleWriter, e
|
||||||
w.Close()
|
w.Close()
|
||||||
}
|
}
|
||||||
stageDir := "/var/hdfs-mount" // TODO: make configurable
|
stageDir := "/var/hdfs-mount" // TODO: make configurable
|
||||||
os.MkdirAll(stageDir, 0700)
|
if ok := os.MkdirAll(stageDir, 0700); ok != nil {
|
||||||
|
Error.Println("Failed to create stageDir /var/hdfs-mount, Error:", ok)
|
||||||
|
return nil, ok
|
||||||
|
}
|
||||||
var err error
|
var err error
|
||||||
this.stagingFile, err = ioutil.TempFile(stageDir, "stage")
|
this.stagingFile, err = ioutil.TempFile(stageDir, "stage")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче