Skip to content

Commit

Permalink
Log WebDav upload errors (#18849)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-lehnen-rc authored Sep 9, 2020
1 parent 9a934f8 commit 0df9b91
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/webdav/server/methods/uploadFileToWebdav.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Meteor } from 'meteor/meteor';

import { settings } from '../../../settings';
import { Logger } from '../../../logger';
import { getWebdavCredentials } from './getWebdavCredentials';
import { WebdavAccounts } from '../../../models';
import { WebdavClientAdapter } from '../lib/webdavClientAdapter';

const logger = new Logger('WebDAV_Upload', {});

Meteor.methods({
async uploadFileToWebdav(accountId, fileData, name) {
if (!Meteor.userId()) {
Expand All @@ -30,6 +33,7 @@ Meteor.methods({
await client.putFileContents(`${ uploadFolder }/${ name }`, buffer, { overwrite: false });
return { success: true };
} catch (error) {
logger.error(error);
if (error.response) {
const { status } = error.response;
if (status === 404) {
Expand Down

0 comments on commit 0df9b91

Please sign in to comment.