Skip to content

Commit f315eb4

Browse files
committed
1 parent 70ab938 commit f315eb4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/msf/core/rpc/v10/rpc_db.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,11 @@ def rpc_get_workspace(wspace)
517517
# Sets a workspace.
518518
#
519519
# @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.
521525
# @return [Hash] A hash indicating whether the action was successful or not. You will get:
522526
# * 'result' [String] A message that says either 'success' or 'failed'
523527
# @example Here's how you would use this from the client:
@@ -526,7 +530,7 @@ def rpc_get_workspace(wspace)
526530
def rpc_set_workspace(wspace)
527531
::ActiveRecord::Base.connection_pool.with_connection {
528532
db_check
529-
workspace = self.framework.db.find_workspace(wspace)
533+
workspace = find_workspace(wspace)
530534
if(workspace)
531535
self.framework.db.workspace = workspace
532536
return { 'result' => "success" }
@@ -551,7 +555,7 @@ def rpc_del_workspace(wspace)
551555
::ActiveRecord::Base.connection_pool.with_connection {
552556
db_check
553557
# Delete workspace
554-
workspace = self.framework.db.find_workspace(wspace)
558+
workspace = find_workspace(wspace)
555559
if workspace.nil?
556560
error(404, "Workspace not found: #{wspace}")
557561
elsif workspace.default?

0 commit comments

Comments
 (0)