• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MerginMaps / input / 5983636709

26 Aug 2023 07:50AM UTC coverage: 62.064% (+1.1%) from 60.955%
5983636709

push

github

web-flow
Lcov to lnx (#2772)

move lcov to linux tests

7552 of 12168 relevant lines covered (62.06%)

102.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

31.58
/app/synchronizationerror.cpp
1
/***************************************************************************
2
 *                                                                         *
3
 *   This program is free software; you can redistribute it and/or modify  *
4
 *   it under the terms of the GNU General Public License as published by  *
5
 *   the Free Software Foundation; either version 2 of the License, or     *
6
 *   (at your option) any later version.                                   *
7
 *                                                                         *
8
 ***************************************************************************/
9

10
#include "synchronizationerror.h"
11

12
SynchronizationError::SynchronizationError() = default;
×
13

14
SynchronizationError::ErrorType SynchronizationError::errorType( int errorCode, const QString &errorMessage )
8✔
15
{
16
  if ( errorCode == 400 )
8✔
17
  {
18
    // 'Another process is running. Please try later.'
19
    if ( errorMessage.contains( QStringLiteral( "Another process" ) ) )
×
20
    {
21
      return ErrorType::AnotherProcessIsRunning;
×
22
    }
23

24
    // 'Version mismatch'
25
    if ( errorMessage.contains( QStringLiteral( "mismatch" ) ) )
×
26
    {
27
      return ErrorType::VersionMismatch;
×
28
    }
29
  }
30
  else if ( errorCode == 403 )
8✔
31
  {
32
    // Cannot sync project
33
    return ErrorType::NoPermissions;
×
34
  }
35
  else if ( errorCode == 404 )
8✔
36
  {
37
    // Project no longer exists / is on different server
38
    return ErrorType::ProjectNotFound;
×
39
  }
40
  else if ( errorCode >= 500 )
8✔
41
  {
42
    // Exceptions in server code or maintenance mode
43
    return ErrorType::ServerError;
×
44
  }
45

46
  return ErrorType::UnknownError;
8✔
47
}
48

49
bool SynchronizationError::isPermanent( ErrorType errorType )
×
50
{
51
  switch ( errorType )
×
52
  {
53
    case AnotherProcessIsRunning:
×
54
      [[fallthrough]];
55
    case VersionMismatch:
56
      [[fallthrough]];
57
    case ServerError: return false;
×
58

59
    default: return true;
×
60
  }
61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc