Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prSimpleNumberSeries throws incomprehensible error for bad inputs #882

Closed
jamshark70 opened this issue Jun 29, 2013 · 0 comments
Closed
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library"

Comments

@jamshark70
Copy link
Contributor

Perhaps some more graceful error handling for this?

Agreed that this is programmer error. But, would it be reasonable to return an empty array in this case instead of throwing an inscrutable error?

var x = 3.26; (x + 0.25, x + 0.5 .. 3.5)

// same as
(3.51, 3.76 .. 3.5)

prSimpleNumberSeries: array size 0 exceeds limit (134217727)

Incidentally, I'm concerned here that the primitive just blindly goes ahead with a nonsense size calculation. Better to check the case rather than hope it doesn't try to allocate too large a memory block.

ERROR: Primitive '_SimpleNumberSeries' failed.
Failed.
RECEIVER:
   Float 3.510000   E147AE14 400C147A
CALL STACK:
    MethodError:reportError   0x2631d88
        arg this = <instance of PrimitiveFailedError>
    Nil:handleError   0x6a3f7d8
        arg this = nil
        arg error = <instance of PrimitiveFailedError>
    Thread:handleError   0x499b198
        arg this = <instance of Thread>
        arg error = <instance of PrimitiveFailedError>
    Object:throw   0x2a26908
        arg this = <instance of PrimitiveFailedError>
    Object:primitiveFailed   0x2625e88
        arg this = 3.51
    Interpreter:interpretPrintCmdLine   0x7fd89c0dc4d8
        arg this = <instance of Interpreter>
        var res = nil
        var func = <instance of Function>
        var code = "var x = 3.26; (x + 0.25, x +..."
        var doc = nil
        var ideClass = <instance of Meta_ScIDE>
    Process:interpretPrintCmdLine   0x3af82e8
        arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Primitive '_SimpleNumberSeries' failed.
Failed.
RECEIVER: 3.51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library"
Projects
None yet
Development

No branches or pull requests

1 participant