001package ch.gbrain.gwtstorage.manager;
002
003/*
004 * #%L
005 * GwtStorage
006 * %%
007 * Copyright (C) 2016 gbrain.ch
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023import com.googlecode.gwtphonegap.client.file.FileError;
024import com.googlecode.gwtphonegap.client.file.FileTransferError;
025import com.googlecode.gwtphonegap.client.file.browser.FileErrorException;
026
027public class StorageError extends FileErrorException
028{
029
030  /**
031   * 
032   */
033  private static final long serialVersionUID = 1L;
034
035  public StorageError(FileError fileError, String reason)
036  {
037    super(fileError.getErrorCode());
038    errorReason = reason;
039  }
040
041  public StorageError(FileError fileError)
042  {
043    super(fileError.getErrorCode());
044  }
045
046  public StorageError(int fileError)
047  {
048    super(fileError);
049  }
050
051  public StorageError(int fileError, String reason)
052  {
053    super(fileError);
054    errorReason = reason;
055  }
056
057  public StorageError(FileTransferError error)
058  {
059    super(FileError.NOT_FOUND_ERR);
060    this.errorReason = error.toString();
061  }
062
063  private String errorReason = "";
064
065  public String getErrorReason()
066  {
067    return errorReason;
068  }
069
070}