@@ -534,6 +534,9 @@ export class Actor<Data extends Dictionary = Dictionary> {
534
534
options . exit ??= true ;
535
535
options . exitCode ??= EXIT_CODES . SUCCESS ;
536
536
options . timeoutSecs ??= 30 ;
537
+
538
+ this . _ensureActorInit ( 'exit' ) ;
539
+
537
540
const client = this . config . getStorageClient ( ) ;
538
541
const events = this . config . getEventManager ( ) ;
539
542
@@ -807,6 +810,8 @@ export class Actor<Data extends Dictionary = Dictionary> {
807
810
* @ignore
808
811
*/
809
812
async reboot ( options : RebootOptions = { } ) : Promise < void > {
813
+ this . _ensureActorInit ( 'reboot' ) ;
814
+
810
815
if ( ! this . isAtHome ( ) ) {
811
816
log . warning (
812
817
'Actor.reboot() is only supported when running on the Apify platform.' ,
@@ -916,6 +921,8 @@ export class Actor<Data extends Dictionary = Dictionary> {
916
921
ow ( statusMessage , ow . string ) ;
917
922
ow ( isStatusMessageTerminal , ow . optional . boolean ) ;
918
923
924
+ this . _ensureActorInit ( 'setStatusMessage' ) ;
925
+
919
926
const loggedStatusMessage = `[Status message]: ${ statusMessage } ` ;
920
927
921
928
switch ( level ) {
@@ -1523,6 +1530,8 @@ export class Actor<Data extends Dictionary = Dictionary> {
1523
1530
defaultValue = { } as State ,
1524
1531
options ?: UseStateOptions ,
1525
1532
) {
1533
+ this . _ensureActorInit ( 'useState' ) ;
1534
+
1526
1535
const kvStore = await KeyValueStore . open ( options ?. keyValueStoreName , {
1527
1536
config : options ?. config || Configuration . getGlobalConfig ( ) ,
1528
1537
} ) ;
0 commit comments