repo: basic support for quota detection
This commit is contained in:
parent
7eccfff019
commit
513febcf1a
|
@ -221,6 +221,12 @@ namespace SparkleLib.Git {
|
||||||
number = (number / 100 * 20);
|
number = (number / 100 * 20);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if (line.StartsWith ("ERROR: QUOTA EXCEEDED")) {
|
||||||
|
int quota_limit = int.Parse (line.Substring (21).Trim ());
|
||||||
|
throw new QuotaExceededException ("Quota exceeded", quota_limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// "Writing objects" stage
|
// "Writing objects" stage
|
||||||
number = (number / 100 * 80 + 20);
|
number = (number / 100 * 80 + 20);
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ SOURCES = \
|
||||||
SparkleBackend.cs \
|
SparkleBackend.cs \
|
||||||
SparkleChangeSet.cs \
|
SparkleChangeSet.cs \
|
||||||
SparkleConfig.cs \
|
SparkleConfig.cs \
|
||||||
|
SparkleExceptions.cs \
|
||||||
SparkleExtensions.cs \
|
SparkleExtensions.cs \
|
||||||
SparkleFetcherBase.cs \
|
SparkleFetcherBase.cs \
|
||||||
SparkleHelpers.cs \
|
SparkleHelpers.cs \
|
||||||
|
|
37
SparkleLib/SparkleExceptions.cs
Normal file
37
SparkleLib/SparkleExceptions.cs
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// SparkleShare, a collaboration and sharing tool.
|
||||||
|
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace SparkleLib {
|
||||||
|
|
||||||
|
public class QuotaExceededException : Exception {
|
||||||
|
|
||||||
|
public readonly int QuotaLimit = -1;
|
||||||
|
|
||||||
|
|
||||||
|
public QuotaExceededException ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public QuotaExceededException (string message, int quota_limit) : base (message)
|
||||||
|
{
|
||||||
|
QuotaLimit = quota_limit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue