<div dir="ltr">Assuming the read call is in your code, you can use readNote and its variants from the 'safe' package.  If it isn't in your code, you may have to modify the library you are using to make use of it in order to find the exact text that is being read unsuccessfully.<br></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 21, 2018 at 4:40 PM PICCA Frederic-Emmanuel <<a href="mailto:frederic-emmanuel.picca@synchrotron-soleil.fr">frederic-emmanuel.picca@synchrotron-soleil.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, I am using the soap package and wrote a StreamParser which use the Consuite Xml system<br>
<br>
I have this kind of error when I execute my code<br>
<br>
[picca@process2 autoprocess-exe]$ stack exec autoprocessing-exe -- exec --json \{\"tag\":\"XdsMe\",\"contents\":[39878,[0,0,0,0,22,0],null,\"UnCompressed\"]\} +RTS -xc -Pa<br>
response:<soap:Envelope xmlns:soap="<a href="http://schemas.xmlsoap.org/soap/envelope/" rel="noreferrer" target="_blank">http://schemas.xmlsoap.org/soap/envelope/</a>"><soap:Body><ns2:findDataCollectionResponse xmlns:ns2="<a href="http://ispyb.ejb3.webservices.collection" rel="noreferrer" target="_blank">http://ispyb.ejb3.webservices.collection</a>"><dataCollection><actualCenteringPosition> /omega=280.000125 /phi=0.000020 /uglidex=-1.403875 /phiz=-0.127760 /chi=0.000005 /uglidey=-0.508216 /zoom=646.972000</actualCenteringPosition><axisEnd>180.0</axisEnd><axisRange>0.1</axisRange><axisStart>0.0</axisStart><beamShape>rectangular</beamShape><beamSizeAtSampleX>100.0</beamSizeAtSampleX><beamSizeAtSampleY>100.0</beamSizeAtSampleY><dataCollectionId>39878</dataCollectionId><dataCollectionNumber>1</dataCollectionNumber><detector2theta>0.0</detector2theta><detectorDistance>296.869</detectorDistance><endTime>2018-11-21T16:54:18+01:00</endTime><exposureTime>0.025</exposureTime><fileTemplate>C2-BZ1692_1</fileTemplate><flux>1.27E10</flux><flux_end>1.27E10</flux_end><imageDirectory>/data4/proxima1-soleil/2018_Run5/2018-11-21/20180897/RAW_DATA/C2/C2-BZ1692</imageDirectory><imagePrefix>C2-BZ1692</imagePrefix><imageSuffix>h5</imageSuffix><kappaStart>0.0</kappaStart><numberOfImages>1800</numberOfImages><numberOfPasses>1</numberOfPasses><overlap>0.0</overlap><phiStart>0.0</phiStart><printableForReport>1</printableForReport><resolution>1.99996</resolution><rotationAxis>Phi</rotationAxis><runStatus>Data collection successful</runStatus><slitGapHorizontal>9999.0</slitGapHorizontal><slitGapVertical>9999.0</slitGapVertical><startImageNumber>1</startImageNumber><startTime>2018-11-21T16:52:42+01:00</startTime><synchrotronMode>Hybrid</synchrotronMode><transmission>20.1</transmission><undulatorGap1>6.4649</undulatorGap1><wavelength>0.978566</wavelength><xbeam>2044.1</xbeam><ybeam>2291.12</ybeam><dataCollectionGroupId>41587</dataCollectionGroupId></dataCollection></ns2:findDataCollectionResponse></soap:Body></soap:Envelope><br>
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace: <br>
  Data.Conduit.Internal.Conduit.fmap.\,<br>
  called from Data.Conduit.Internal.Conduit.fmap,<br>
  called from Network.SOAP.Parsing.Stream.readContent,<br>
  called from Network.SOAP.Parsing.Stream.readTag,<br>
  called from ISPyB.Soap.toResponseParser,<br>
  called from Data.Conduit.Internal.Conduit.pure,<br>
  called from Data.Conduit.Internal.Conduit.>>=.\.\,<br>
  called from Data.Conduit.Internal.Conduit.>>=.\,<br>
  called from Data.Conduit.Internal.Conduit.>>=,<br>
  called from Text.XML.Stream.Parse.force,<br>
  called from Network.SOAP.unwrapEnvelopeSink,<br>
  called from Network.SOAP.runResponseParser,<br>
  called from Network.SOAP.invokeWS,<br>
  called from ISPyB.Soap.callISPyBService,<br>
  called from XdsMe.xdsme,<br>
  called from JobParser.runJob,<br>
  called from Main.run,<br>
  called from Main.main<br>
autoprocessing-exe: Prelude.read: no parse<br>
CallStack (from -prof):<br>
  Data.Conduit.Internal.Conduit.fmap.\ (src/Data/Conduit/Internal/Conduit.hs:140:47-58)<br>
  Data.Conduit.Internal.Conduit.fmap (src/Data/Conduit/Internal/Conduit.hs:140:5-58)<br>
  Network.SOAP.Parsing.Stream.readContent (src/Network/SOAP/Parsing/Stream.hs:57:1-46)<br>
  Network.SOAP.Parsing.Stream.readTag (src/Network/SOAP/Parsing/Stream.hs:61:1-33)<br>
  ISPyB.Soap.toResponseParser (src/ISPyB/Soap.hs:(65,5)-(129,74))<br>
  Data.Conduit.Internal.Conduit.pure (src/Data/Conduit/Internal/Conduit.hs:143:5-27)<br>
  Data.Conduit.Internal.Conduit.>>=.\.\ (src/Data/Conduit/Internal/Conduit.hs:150:51-68)<br>
  Data.Conduit.Internal.Conduit.>>=.\ (src/Data/Conduit/Internal/Conduit.hs:150:41-68)<br>
  Data.Conduit.Internal.Conduit.>>= (src/Data/Conduit/Internal/Conduit.hs:150:5-68)<br>
  Text.XML.Stream.Parse.force (Text/XML/Stream/Parse.hs:873:1-68)<br>
  Network.SOAP.unwrapEnvelopeSink (src/Network/SOAP.hs:(79,1)-(81,30))<br>
  Network.SOAP.runResponseParser (src/Network/SOAP.hs:(61,1)-(76,31))<br>
  Network.SOAP.invokeWS (src/Network/SOAP.hs:(55,1)-(58,27))<br>
  ISPyB.Soap.callISPyBService (src/ISPyB/Soap.hs:(310,1)-(325,93))<br>
  XdsMe.xdsme (src/XdsMe.hs:(176,1)-(179,77))<br>
  JobParser.runJob (src/JobParser.hs:(80,1)-(84,57))<br>
  Main.run (app/Main.hs:(112,1)-(114,31))<br>
  Main.main (app/Main.hs:(118,1)-(123,72))<br>
<br>
<br>
I generate the stacktrace with  RTS.<br>
<br>
but now I know theat my error is in the roRespondParser whcih is quite long<br>
<br>
here the code<br>
<br>
<br>
instance a ~ b => ToResponseParser (ToolsForCollectionWebService a) b where<br>
    toResponseParser (FindDataCollection _) =<br>
        StreamParser . flaxTag "findDataCollectionResponse" . flaxTag "dataCollection" $<br>
        mkSomeDataCollection <$><br>
                     ( DataCollection<br>
                       <$> flaxContent "actualCenteringPosition"<br>
                       <*> readTag "axisEnd"<br>
                       <*> readTag "axisRange"<br>
                       <*> readTag "axisStart"<br>
                       <*> flaxContent "beamShape"<br>
                       <*> readTag "beamSizeAtSampleX"<br>
                       <*> readTag "beamSizeAtSampleY"<br>
                       <*> laxTag "centeringMethod" readContent<br>
                       <*> (DataCollectionId <$> readTag "dataCollectionId")<br>
                       <*> readTag "dataCollectionNumber"<br>
                       <*> readTag "detector2theta"<br>
                       <*> readTag "detectorDistance"<br>
                       <*> flaxContent "endTime"<br>
                       <*> readTag "exposureTime"<br>
                       <*> flaxContent "fileTemplate"<br>
                       <*> readTag "flux"<br>
                       <*> readTag "flux_end"<br>
                       <*> flaxTag "imageDirectory" parseAbsDir'<br>
                       <*> flaxContent "imagePrefix"<br>
                       <*> laxContent "imageSuffix"<br>
                       <*> readTag "kappaStart"<br>
                       <*> readTag "numberOfImages"<br>
                       <*> readTag "numberOfPasses"<br>
                       <*> laxTag "omegaStart" readContent<br>
                       <*> readTag "overlap"<br>
                       <*> readTag "phiStart"<br>
                       <*> readTag "printableForReport"<br>
                       <*> readTag "resolution"<br>
                       <*> laxTag "resolutionAtCorner" readContent<br>
                       <*> readTag "rotationAxis"<br>
                       <*> flaxContent "runStatus"<br>
                       <*> readTag "slitGapHorizontal"<br>
                       <*> readTag "slitGapVertical"<br>
                       <*> readTag "startImageNumber"<br>
                       <*> readTag "startTime"<br>
                       <*> readTag "synchrotronMode"<br>
                       <*> readTag "transmission"<br>
                       <*> readTag "undulatorGap1"<br>
                       <*> laxTag "undulatorGap2" readContent<br>
                       <*> readTag "wavelength" -- add the unit<br>
                       <*> readTag "xbeam"<br>
                       <*> laxTag "xtalSnapshotFullPath1" parseAbsFile'<br>
                       <*> laxTag "xtalSnapshotFullPath2" parseAbsFile'<br>
                       <*> laxTag "xtalSnapshotFullPath3" parseAbsFile'<br>
                       <*> laxTag "xtalSnapshotFullPath4" parseAbsFile'<br>
                       <*> readTag "ybeam"<br>
                       <*> readTag "dataCollectionGroupId"<br>
                     )<br>
<br>
<br>
Now I would like to know whcih line is problematic. Is it possible to have more information when debuging ?<br>
<br>
I really want to know which part of my response is wrong ?<br>
<br>
thansk for your advices.<br>
<br>
Frederic<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div>