ENH : raise on invalid linestyle

Added check in code + test for raise

Please review and merge.