Skip to content

Commit

Permalink
Added error handling for token file
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwgardner committed Jun 10, 2015
1 parent d8406d2 commit 5fd8e3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,7 +1,7 @@
Package: alation
Type: Package
Title: Package to connect to Alation API
Version: 1.3
Version: 1.4
Date: 2015-06-02
Author: Matt Gardner <magardner@ebay.com>
Maintainer: Matt Gardner <magardner@ebay.com>
Expand Down
10 changes: 9 additions & 1 deletion R/alation.R
Expand Up @@ -78,7 +78,7 @@ getToken <- function(user="", password="", url="")


if( result == "EXISTING"){
cat("Token already exists - to create a new token use changeToken().\n")
cat("Token already exists - to update your token use changeToken().\n")
return(NULL)
}

Expand Down Expand Up @@ -196,6 +196,10 @@ getQuery <- function(id)

path <- path.package("alation")
f <- paste(path,"/.token",sep="")

if(!file.exists(f)) {
stop("You need an Alation token before calling getQuery() - see getToken() for details.")
}
load(f)

header <- basicTextGatherer()
Expand Down Expand Up @@ -234,6 +238,10 @@ getResult <- function(id)

path <- path.package("alation")
f <- paste(path,"/.token",sep="")

if(!file.exists(f)) {
stop("You need an Alation token before calling getResult() - see getToken() for details.")
}
load(f)

header <- basicTextGatherer()
Expand Down

0 comments on commit 5fd8e3f

Please sign in to comment.