@@ -305,8 +305,10 @@ void output_flex_t::check_context_and_state(char const *name,
305
305
char const *context, bool condition)
306
306
{
307
307
if (condition) {
308
- throw fmt_error (" The function {}() can only be called from the {}." ,
309
- name, context);
308
+ throw fmt_error (
309
+ " The function {}() can only be called (directly or indirectly) "
310
+ " from the process_[untagged]_{}() functions." ,
311
+ name, context);
310
312
}
311
313
312
314
if (lua_gettop (lua_state ()) > 1 ) {
@@ -317,7 +319,7 @@ void output_flex_t::check_context_and_state(char const *name,
317
319
int output_flex_t::app_get_bbox ()
318
320
{
319
321
check_context_and_state (
320
- " get_bbox" , " process_node /way/relation() functions " ,
322
+ " get_bbox" , " node /way/relation" ,
321
323
m_calling_context != calling_context::process_node &&
322
324
m_calling_context != calling_context::process_way &&
323
325
m_calling_context != calling_context::process_relation);
@@ -367,7 +369,7 @@ int output_flex_t::app_get_bbox()
367
369
368
370
int output_flex_t::app_as_point ()
369
371
{
370
- check_context_and_state (" as_point" , " process_node() function " ,
372
+ check_context_and_state (" as_point" , " node " ,
371
373
m_calling_context != calling_context::process_node);
372
374
373
375
auto *geom = create_lua_geometry_object (lua_state ());
@@ -378,7 +380,7 @@ int output_flex_t::app_as_point()
378
380
379
381
int output_flex_t::app_as_linestring ()
380
382
{
381
- check_context_and_state (" as_linestring" , " process_way() function " ,
383
+ check_context_and_state (" as_linestring" , " way " ,
382
384
m_calling_context != calling_context::process_way);
383
385
384
386
m_way_cache.add_nodes (middle ());
@@ -391,7 +393,7 @@ int output_flex_t::app_as_linestring()
391
393
392
394
int output_flex_t::app_as_polygon ()
393
395
{
394
- check_context_and_state (" as_polygon" , " process_way() function " ,
396
+ check_context_and_state (" as_polygon" , " way " ,
395
397
m_calling_context != calling_context::process_way);
396
398
397
399
m_way_cache.add_nodes (middle ());
@@ -405,7 +407,7 @@ int output_flex_t::app_as_polygon()
405
407
int output_flex_t::app_as_multipoint ()
406
408
{
407
409
check_context_and_state (
408
- " as_multipoint" , " process_node /relation() functions " ,
410
+ " as_multipoint" , " node /relation" ,
409
411
m_calling_context != calling_context::process_node &&
410
412
m_calling_context != calling_context::process_relation);
411
413
@@ -423,10 +425,10 @@ int output_flex_t::app_as_multipoint()
423
425
424
426
int output_flex_t::app_as_multilinestring ()
425
427
{
426
- check_context_and_state (
427
- " as_multilinestring " , " process_way/relation() functions " ,
428
- m_calling_context != calling_context::process_way &&
429
- m_calling_context != calling_context::process_relation);
428
+ check_context_and_state (" as_multilinestring " , " way/relation " ,
429
+ m_calling_context != calling_context:: process_way &&
430
+ m_calling_context !=
431
+ calling_context::process_relation);
430
432
431
433
if (m_calling_context == calling_context::process_way) {
432
434
m_way_cache.add_nodes (middle ());
@@ -447,10 +449,10 @@ int output_flex_t::app_as_multilinestring()
447
449
448
450
int output_flex_t::app_as_multipolygon ()
449
451
{
450
- check_context_and_state (
451
- " as_multipolygon " , " process_way/relation() functions " ,
452
- m_calling_context != calling_context::process_way &&
453
- m_calling_context != calling_context::process_relation);
452
+ check_context_and_state (" as_multipolygon " , " way/relation " ,
453
+ m_calling_context != calling_context:: process_way &&
454
+ m_calling_context !=
455
+ calling_context::process_relation);
454
456
455
457
if (m_calling_context == calling_context::process_way) {
456
458
m_way_cache.add_nodes (middle ());
@@ -473,9 +475,9 @@ int output_flex_t::app_as_multipolygon()
473
475
474
476
int output_flex_t::app_as_geometrycollection ()
475
477
{
476
- check_context_and_state (
477
- " as_geometrycollection " , " process_relation() function " ,
478
- m_calling_context != calling_context::process_relation);
478
+ check_context_and_state (" as_geometrycollection " , " relation " ,
479
+ m_calling_context !=
480
+ calling_context::process_relation);
479
481
480
482
m_relation_cache.add_members (middle ());
481
483
0 commit comments