summaryrefslogtreecommitdiffstats
path: root/api/file.go
diff options
context:
space:
mode:
authorKhoa LĂȘ <khoaln6@gmail.com>2016-05-31 21:35:08 +0700
committerChristopher Speller <crspeller@gmail.com>2016-05-31 10:35:08 -0400
commit397e0a3f683e324ce2d4d16c8a7f3f9346c8566b (patch)
tree0f236ed85439bfbeacbf7ff84490d76269ed69ed /api/file.go
parentc5deb333db40e4e527f98edb93b41d1b66cfec5f (diff)
downloadchat-397e0a3f683e324ce2d4d16c8a7f3f9346c8566b.tar.gz
chat-397e0a3f683e324ce2d4d16c8a7f3f9346c8566b.tar.bz2
chat-397e0a3f683e324ce2d4d16c8a7f3f9346c8566b.zip
PLT-2061 Include FULL PATH in logs when referring to a directory (#3170)
Diffstat (limited to 'api/file.go')
-rw-r--r--api/file.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/api/file.go b/api/file.go
index e29bb072a..92bceaa80 100644
--- a/api/file.go
+++ b/api/file.go
@@ -623,7 +623,8 @@ func MoveFile(oldPath, newPath string) *model.AppError {
func WriteFileLocally(f []byte, path string) *model.AppError {
if err := os.MkdirAll(filepath.Dir(path), 0774); err != nil {
- return model.NewLocAppError("WriteFile", "api.file.write_file_locally.create_dir.app_error", nil, err.Error())
+ directory, _ := filepath.Abs(filepath.Dir(path))
+ return model.NewLocAppError("WriteFile", "api.file.write_file_locally.create_dir.app_error", nil, "directory="+directory+", err="+err.Error())
}
if err := ioutil.WriteFile(path, f, 0644); err != nil {