Преглед изворни кода

Merge pull request #133 from jakesmith/topull/issue132

FIX: #132 - minor tidy of inconsistent exceptions

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman пре 14 година
родитељ
комит
30939cb90d

+ 1 - 1
thorlcr/activities/group/thgroupslave.cpp

@@ -106,7 +106,7 @@ public:
                 }
                 catch (IThorRowArrayException *e)
                 {
-                    IException *e2 = MakeActivityException(this, e, "Group (%"ACTPF"d) [during rollover]", container.queryId());
+                    IException *e2 = MakeActivityException(this, e, "Group [rollover]");
                     e->Release();
                     throw e2;
                 }

+ 1 - 1
thorlcr/activities/indexread/thindexreadslave.cpp

@@ -54,7 +54,7 @@ static IKeyIndex *openKeyPart(CActivityBase *activity, const char *logicalFilena
     if (!(globals->getPropBool("@autoCopyBackup", true)?ensurePrimary(activity, partDesc, ifile, location, filePath):getBestFilePart(activity, partDesc, ifile, location, filePath, activity)))
     {
         StringBuffer locations;
-        IException *e = MakeActivityException(activity, TE_FileNotFound, "INDEXREAD(%"ACTPF"d): no physical file part for logical key file %s, found at given locations: %s (Error = %d)", activity->queryContainer().queryId(), logicalFilename, getFilePartLocations(partDesc, locations).str(), GetLastError());
+        IException *e = MakeActivityException(activity, TE_FileNotFound, "No physical file part for logical key file %s, found at given locations: %s (Error = %d)", logicalFilename, getFilePartLocations(partDesc, locations).str(), GetLastError());
         EXCLOG(e, NULL);
         throw e;
     }

+ 1 - 1
thorlcr/activities/keyedjoin/thkeyedjoinslave.cpp

@@ -1722,7 +1722,7 @@ public:
                     {
                         inputHelper->queryOutputMeta()->toXML((byte *) jg->queryLeft(), xmlwrite);
                     }
-                    throw MakeThorException(0, "KEYEDJOIN(%"ACTPF"d): More than %d match candidates in keyed join for row %s", container.queryId(), abortLimit, xmlwrite.str());
+                    throw MakeActivityException(this, 0, "More than %d match candidates in keyed join for row %s", abortLimit, xmlwrite.str());
                 }
                 catch (IException *_e)
                 {

+ 2 - 2
thorlcr/activities/msort/thgroupsortslave.cpp

@@ -273,7 +273,7 @@ public:
         if (ret && prev && icompare->docompare(prev, ret) > 0)
         {
             // MORE - better to give mismatching rows than indexes?
-            throw MakeActivityException(this, TE_NotSorted, "detected incorrectly sorted rows (row %"ACTPF"d,  %"ACTPF"d))", getDataLinkCount(), getDataLinkCount()+1);
+            throw MakeActivityException(this, TE_NotSorted, "detected incorrectly sorted rows (row %"RCPF"d,  %"RCPF"d))", getDataLinkCount(), getDataLinkCount()+1);
         }
         prev.set(ret);
         if (ret)
@@ -292,7 +292,7 @@ public:
         if (ret && prev && stepCompare->docompare(prev, ret, numFields) > 0)
         {
             // MORE - better to give mismatching rows than indexes?
-            throw MakeActivityException(this, TE_NotSorted, "detected incorrectly sorted rows (row %"ACTPF"d,  %"ACTPF"d))", getDataLinkCount(), getDataLinkCount()+1);
+            throw MakeActivityException(this, TE_NotSorted, "detected incorrectly sorted rows (row %"RCPF"d,  %"RCPF"d))", getDataLinkCount(), getDataLinkCount()+1);
         }
         prev.set(ret);
         if (ret)

+ 2 - 2
thorlcr/activities/pipethrough/thptslave.cpp

@@ -285,7 +285,7 @@ public:
         if (wrexc)
             throw wrexc.getClear();
         if (retcode!=0)
-            throw MakeThorException(TE_PipeReturnedFailure, "PIPETHROUGH(%"ACTPF"d), Process returned %d", container.queryId(), retcode);
+            throw MakeActivityException(this, TE_PipeReturnedFailure, "Process returned %d", retcode);
     }
     void abort()
     {
@@ -333,7 +333,7 @@ public:
                         e->Release();
                     }
                 }
-                throw MakeThorException(TE_PipeReturnedFailure, "PIPETHROUGH(%"ACTPF"d), Process returned %d:%s - PIPE(%s)", container.queryId(), retcode, stdError.str(), pipeCommand.get());
+                throw MakeActivityException(this, TE_PipeReturnedFailure, "Process returned %d:%s - PIPE(%s)", retcode, stdError.str(), pipeCommand.get());
             }
         }
     }