@@ -517,7 +517,11 @@ def rpc_get_workspace(wspace)
517
517
# Sets a workspace.
518
518
#
519
519
# @param [String] wspace Workspace name.
520
- # @raise [Msf::RPC::Exception] 500 Database not loaded.
520
+ # @raise [Msf::RPC::ServerException] You might get one of these errors:
521
+ # * 500 ActiveRecord::ConnectionNotEstablished. Try: rpc.call('console.create').
522
+ # * 500 Database not loaded. Try: rpc.call('console.create')
523
+ # * 500 Invalid workspace
524
+ # * 404 Workspace not found.
521
525
# @return [Hash] A hash indicating whether the action was successful or not. You will get:
522
526
# * 'result' [String] A message that says either 'success' or 'failed'
523
527
# @example Here's how you would use this from the client:
@@ -526,7 +530,7 @@ def rpc_get_workspace(wspace)
526
530
def rpc_set_workspace ( wspace )
527
531
::ActiveRecord ::Base . connection_pool . with_connection {
528
532
db_check
529
- workspace = self . framework . db . find_workspace ( wspace )
533
+ workspace = find_workspace ( wspace )
530
534
if ( workspace )
531
535
self . framework . db . workspace = workspace
532
536
return { 'result' => "success" }
@@ -551,7 +555,7 @@ def rpc_del_workspace(wspace)
551
555
::ActiveRecord ::Base . connection_pool . with_connection {
552
556
db_check
553
557
# Delete workspace
554
- workspace = self . framework . db . find_workspace ( wspace )
558
+ workspace = find_workspace ( wspace )
555
559
if workspace . nil?
556
560
error ( 404 , "Workspace not found: #{ wspace } " )
557
561
elsif workspace . default?
0 commit comments