"An error occurred while generating the results"

I get the following error when trying to visualise a polyline: “An error occurred while generating the results”. This isn’t a very helpful error message.

The code is below:

from viktor import ViktorController
from viktor.parametrization import ViktorParametrization
from viktor.geometry import Point, Polyline
from viktor.views import GeometryView, GeometryResult

class Parametrization(ViktorParametrization):
    pass

class Controller(ViktorController):
    label = "My Entity Type"
    parametrization = Parametrization

    @GeometryView("3D", duration_guess=1)
    def get_geometry(self, params, **kwargs):
        test = Polyline(Point(0, 0, 0), Point(1,1,1), Point(3, 3, 3))
        return GeometryResult(test)

I get the following output from the CLI:

: App is ready
: Job (uid: 4594) received - EntityType: Controller - call: parametrization
: Job (uid: 4594) completed in 0ms

If anyone can help, I’d greatly appreciate it.

Hi Thomas,

I am not sure why your cli is not giving proper error messages, maybe stopping and starting you cli will fix that. Recreating the error resulted in an proper error message on my end.

Tip: you might want to add a simple ToggleButton to your parametrization so you can easily trigger the view to recalculate.

But what i noticed in the code is that Polyline takes a list of points as the first argument, but you are providing all points as separate arguments.
so when you change that line into:

        test = Polyline([Point(0, 0, 0), Point(1, 1, 1), Point(3, 3, 3)])

It will probably work.

Hope this helps,

Greeting,

Maarten