It is currently April 25th, 2024, 5:25 pm
RegExp matching error (-1), (-8)
-
- Posts: 182
- Joined: April 10th, 2014, 12:31 am
- Location: Canada
RegExp matching error (-1), (-8)
In testing my weather skin, I've been trying different cities. In so doing, I've received some RegExp matching errors in the log; some with (-1) and some with (-8). Searching the documentation and the forum hasn't turned up a description of what the numbers refer to. Is there a list somewhere?
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: RegExp matching error (-1), (-8)
As far as I know, these are the error codes returned by PCRE (Perl Compatible Regular Expression)
I'm not entirely sure they are of much value in debugging stuff, but in general -1 is just "no match", and -8 means that its attempt to resolve the match has resulted in an endless loop that exceeds an internal limit in PCRE. Both are just an invalid regular expression for the string being parsed.
#define PCRE_ERROR_NOMATCH (-1)
#define PCRE_ERROR_NULL (-2)
#define PCRE_ERROR_BADOPTION (-3)
#define PCRE_ERROR_BADMAGIC (-4)
#define PCRE_ERROR_UNKNOWN_OPCODE (-5)
#define PCRE_ERROR_UNKNOWN_NODE (-5) /* For backward compatibility */
#define PCRE_ERROR_NOMEMORY (-6)
#define PCRE_ERROR_NOSUBSTRING (-7)
#define PCRE_ERROR_MATCHLIMIT (-8)
#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */
#define PCRE_ERROR_BADUTF8 (-10) /* Same for 8/16/32 */
#define PCRE_ERROR_BADUTF16 (-10) /* Same for 8/16/32 */
#define PCRE_ERROR_BADUTF32 (-10) /* Same for 8/16/32 */
#define PCRE_ERROR_BADUTF8_OFFSET (-11) /* Same for 8/16 */
#define PCRE_ERROR_BADUTF16_OFFSET (-11) /* Same for 8/16 */
#define PCRE_ERROR_PARTIAL (-12)
#define PCRE_ERROR_BADPARTIAL (-13)
#define PCRE_ERROR_INTERNAL (-14)
#define PCRE_ERROR_BADCOUNT (-15)
#define PCRE_ERROR_DFA_UITEM (-16)
#define PCRE_ERROR_DFA_UCOND (-17)
#define PCRE_ERROR_DFA_UMLIMIT (-18)
#define PCRE_ERROR_DFA_WSSIZE (-19)
#define PCRE_ERROR_DFA_RECURSE (-20)
#define PCRE_ERROR_RECURSIONLIMIT (-21)
#define PCRE_ERROR_NULLWSLIMIT (-22) /* No longer actually used */
#define PCRE_ERROR_BADNEWLINE (-23)
#define PCRE_ERROR_BADOFFSET (-24)
#define PCRE_ERROR_SHORTUTF8 (-25)
#define PCRE_ERROR_SHORTUTF16 (-25) /* Same for 8/16 */
#define PCRE_ERROR_RECURSELOOP (-26)
#define PCRE_ERROR_JIT_STACKLIMIT (-27)
#define PCRE_ERROR_BADMODE (-28)
#define PCRE_ERROR_BADENDIANNESS (-29)
#define PCRE_ERROR_DFA_BADRESTART (-30)
#define PCRE_ERROR_JIT_BADOPTION (-31)
#define PCRE_ERROR_BADLENGTH (-32)
#define PCRE_ERROR_UNSET (-33)
I'm not entirely sure they are of much value in debugging stuff, but in general -1 is just "no match", and -8 means that its attempt to resolve the match has resulted in an endless loop that exceeds an internal limit in PCRE. Both are just an invalid regular expression for the string being parsed.
-
- Posts: 182
- Joined: April 10th, 2014, 12:31 am
- Location: Canada
Re: RegExp matching error (-1), (-8)
Thanks for that!
Alas, the weather site has thrown a curve, and I see now that some regex modification is necessary for the (-1) issue. But the (-8) issue is another story, that I'm going to have to dig into.
It seems the weather skin requires constant babysitting!
Alas, the weather site has thrown a curve, and I see now that some regex modification is necessary for the (-1) issue. But the (-8) issue is another story, that I'm going to have to dig into.
It seems the weather skin requires constant babysitting!
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: RegExp matching error (-1), (-8)
I find that WXData is pretty consistent, with the following caveat. From time to time their feed will be missing some data. This is just a problem on their end, and really nothing you can do about it. If you use an approach like I do, where you get the entire site as a single "super parent", and then use "parents" to get different sections of the feed, and "children" to return the individual bits, having some part of the information missing in the feed doesn't have to be entirely fatal to the skin. It will get and display what it can, and return empty strings (and yes, an error in the log) for the missing stuff. Generally speaking, WXData will straighten itself out in some matter of minutes, or hours, or a day or two at worst.qwerky wrote: ↑March 21st, 2019, 11:02 pm Thanks for that!
Alas, the weather site has thrown a curve, and I see now that some regex modification is necessary for the (-1) issue. But the (-8) issue is another story, that I'm going to have to dig into.
It seems the weather skin requires constant babysitting!
https://forum.rainmeter.net/viewtopic.php?f=118&t=23169
-
- Posts: 182
- Joined: April 10th, 2014, 12:31 am
- Location: Canada
Re: RegExp matching error (-1), (-8)
Thanks for that! It makes me feel great, because that is exactly what I have done in my own skin, using a single parent to read the site (in my case, https://weather.gc.ca/ specifically for Canadian weather), then other child/parent measures for groups of data, then finally child measures for individual items.jsmorley wrote: ↑March 21st, 2019, 11:07 pm I find that WXData is pretty consistent, with the following caveat. From time to time their feed will be missing some data. This is just a problem on their end, and really nothing you can do about it. If you use an approach like I do, where you get the entire site as a single "super parent", and then use "parents" to get different sections of the feed, and "children" to return the individual bits, having some part of the information missing in the feed doesn't have to be entirely fatal to the skin. It will get and display what it can, and return empty strings (and yes, an error in the log) for the missing stuff. Generally speaking, WXData will straighten itself out in some matter of minutes, or hours, or a day or two at worst.
https://forum.rainmeter.net/viewtopic.php?f=118&t=23169
It's just that I keep coming across new conditions in the weather feed, that I have to now account for. For example, the season for Wind Chill is pretty much past, but soon there will be a Heat Index or Feels Like item that will need to be worked in. Today, I came across a page that had not one, but two weather alerts; this caused some items to go missing, but as you said, because of the above grouping, it was only a small number of items, and the remainder of the skin continued to display as expected.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: RegExp matching error (-1), (-8)
So you are making a "Do I need a toque?" skin?
-
- Posts: 182
- Joined: April 10th, 2014, 12:31 am
- Location: Canada
-
- Rainmeter Sage
- Posts: 7164
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: RegExp matching error (-1), (-8)
Many many thanks for that. This will surely be very useful in debugging such errors.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: RegExp matching error (-1), (-8)
Drat. My spelling failed me...
-
- Posts: 182
- Joined: April 10th, 2014, 12:31 am
- Location: Canada